[mod_python] mod_python and Django

Jorey Bump list at joreybump.com
Wed Jul 27 12:06:27 EDT 2005


Dagur Pall Ammendrup wrote:

> The thing is that I have my project directory in sys.path (and it
> appears if I try to print it out in a mod_python test page) but if I try
> to import anything I'm told it doesn't exist.

Only modules or packages can be imported, so if you're trying to import 
~dagur/workspace/myproject/settings/main.py, it must be packaged:

touch ~dagur/workspace/myproject/__init__.py
touch ~dagur/workspace/myproject/settings/__init__.py

It isn't necessary to put anything in __init__.py, but the files must exist.


More information about the Mod_python mailing list