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

Solution 1:

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.

Solution 2:

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.