December 2016
Beginner to intermediate
694 pages
14h 2m
English
When you use Django, you have to tell it which settings you're using. Do this by using an environment variable, DJANGO_SETTINGS_MODULE. The value of DJANGO_SETTINGS_MODULE should be in Python path syntax, for example, mysite.settings.
When using django-admin, you can either set the environment variable once, or explicitly pass in the settings module each time you run the utility. Example (Unix Bash shell):
export DJANGO_SETTINGS_MODULE=mysite.settings
django-admin runserver
Example (Windows shell):
set DJANGO_SETTINGS_MODULE=mysite.settings
django-admin runserver
Use the --settings command-line argument to specify the settings manually:
django-admin runserver --settings=mysite.settings
Read now
Unlock full access