[Fixed]-Django – no module named app

12👍

Does your basic have __init__.py?

👤lprsd

4👍

You need to make sure that the project is in your PYTHONPATH. Maybe try to output the sys.path variable at the top of your settings file:

import sys
print sys.path

If this doesn’t work with mod_python try to write it to a file:

import sys
file('/tmp/mysyspath.txt', 'w').write(repr(sys.path))

But even if that will work, here is a short warning:
It’s discouraged in the django community to use mod_python. It’s no longer maintained by its creators and was never the best solution to deploy your django project. Please try mod_wsgi if its available for you on your server.

0👍

Normally the project directory is added to sys.path and then the app name is used directly in INSTALLED_APPS and in imports in other apps. Give this a try.

Leave a comment