Skip to content

Django local dev: Specifying the settings option in the virtual environment

mhulse edited this page Dec 17, 2014 · 1 revision

When Developing Django locally, you’ll probably end up using the --settings command line option:

$ python manage.py runserver --settings=repower.settings.local

This can be annoying to type each time. To make that option automatic (i.e., implied), crack open the activate file inside your virtualenv (e.g., ~/.virtualenvs/FOO/bin/activate) and append:

export DJANGO_SETTINGS_MODULE="repower.settings.local"
echo $DJANGO_SETTINGS_MODULE

Now you can run $ python manage.py commands without having to specify your local development settings file each time.

Clone this wiki locally