I have a settings.py file and a dev_settings.py file that I use to override some values for dev purposes. Everytime I run the ./manage.py command, I have to specify --settings=whatever.local_settings. This becomes very tedious to do every time and I am trying to find a way to force manage.py to load my dev_settings.py file every by default so that I don’t have to type that long argument every time I want to run a command.
I have tried setting DJANGO_SETTINGS_MODULE, however, it appears that manage.py overrides this option.
Is it possible to make this happen or am I doomed to always specify that argument?
manage.pysets path to settings for you, that’s why it’s ignoringDJANGO_SETTINGS_MODULE(it’s basically just script that wraps arounddjango-admin.py).There are 2 easy ways to fix your problem:
set
DJANGO_SETTINGS_MODULEand usedjango-admin.pyto run all commands instead ofmanage.py. This is even better if you use vitualenv.copy
manage.pyand name itlocal.py(that’s the name in my case) and rename allsettingsmentions todev_settings.For example:
You can run all commands by
./local.pynow.