It's quite likely your local Django project will have slightly different settings to your live Django project - even if it is only database access details. Here is a simple way of switching with exactly the same codebase in each. (This is really for Linux/Mac OS but can be done on Windows as well)
In you application root (where
settings.py currently is) create a folder called
In this new folder create 4 files,
Add you current
settings.py content to
main.py and delete the
__init__.py add the following
import os dev = os.environ.get('DJANGO_DEV', False) from main import * if dev: from dev import * else: from live import *
Now create an environment variable that is loaded every time you open the terminal window.
On OS X edit your ~/.bash_profile file, on Linux it is ~/.bashrc - with the following
Now, whenever loading settings, your developement version will load the default and any custom settings you have in your
dev.py file. Where using source control, you may want to add this as an exception therefore having specific development config on each of the development machines.