How do I stop getting ImportError: Could not import settings 'mofin.settings' when using django with wsgi? How do I stop getting ImportError: Could not import settings 'mofin.settings' when using django with wsgi? python python

How do I stop getting ImportError: Could not import settings 'mofin.settings' when using django with wsgi?


This can also happen if you have an application (subdirectory to the project with an init file in it) named the same thing as the project. Your settings.py file may be in your project folder, but it seems that a part of the django system looks first for a module inside the project by the same name as the project and when it can't find a settings.py in there, it fails with a misleading message.

-uniquename1---settings.py---manage.py---application1-----file.py-----file2.py---uniquename1  (problem, rename this to some other unique name)-----file.py-----file2.py

Just something else to check for anyone else having this problem. Applies to Django 1.3 and probably others.


I had a similar permissions problem, and although my settings.py had the right permissions, the .pyc's did not!!! So watch out for this.


Hey, just adding an additional answer to this problem. I had the exact same issue, but it wasn't file permissions. I was appending "path/to/project", but not also appending "path/to". Linked is mod_wsgi's Django integration explanation that showed me the answer.