Answer the question
In order to leave comments, you need to log in
Where to define DJANGO_SETTINGS_MODULE?
The DJANGO_SETTINGS_MODULE environment variable is defined by default in two django project files, namely manage.py and wsgi.py. At some points, it needs to be defined in settings.py , how to do it, and most importantly, why?
"The DJANGO_SETTINGS_MODULE value must contain the Python import path, such as mysite.settings."
I had a problem deploying to pythonanywhere after changing this variable in manage.py and wsgi.py. I changed the name of the project folder in which settings.py is located to config and registered the same path in manage.py and wsgi.py, respectively changing the variables in settings.py along the way. Further, when setting up the wsgi file of the server, I registered the same paths,
os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings'
Error running WSGI application
ImportError: No module named config.settings
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question