On running Django, I frequently get the following error:
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
How do I set the environment variables correctly? I tried the solution here but did not have any success.
You can set an environment variable with a command like:
Assuming that
application.settings
is in Python's path, you should then be able to rundjango-admin
using those settings. Alternatively, you can pass a settings module todjango-admin
on the command line: