Local Development Settings File

Posted: March 17th, 2010 | Author: Arif Harbott | Filed under: Django | Tags: , | No Comments »

If you want to have local development settings in your Django project but don’t fancy having multiple versions of settings.py then you can use the following snippet at the end of your settings.py file.

# Import server specific settings
try:
    from settings_local import *
except ImportError:
    pass

Then put any local development settings in a file called settings_local.py and you can override anything from settings.py.
If settings_local.py does not exist on your production server no error is thrown.