[Django]-Django: wsgi import setting error modeule named mysite.settings not found

2👍

Original answer was me mistakenly thinking your sys.path was incorrect.

New theory is that you say your settings.py lives in .../django/mysite/scr/, so specifying mysite.settings wouldn’t be valid.

Technically, assuming mysite has an __init__.py file, the path to your settings file is mysite.scr.settings

3👍

If settings.py is in /usr/local/django/mysite/scr/, then fairly obviously you should use:

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.scr.settings'

1👍

A couple of things you could try.

Does the test server “runserver’ work? If it doesn’t it may be that you have an error in your settings file or one of the other files it loads

The order of ‘INSTALLED APPS’ can be important. For one of my projects this error went away when I changed the order of installed apps.

The answers to this question I asked a bit ago may be helpful.
How do I stop getting ImportError: Could not import settings 'mofin.settings' when using django with wsgi?

👤Dan

Leave a comment