0

My Django project is placed in /www/host1/htdocs/my/project, www and my are links to other actual folders. Apache has mod_python enabled. I have a .htaccess in project folder:

SetHandler python-program 
PythonHandler django.core.handlers.modpython 
SetEnv DJANGO_SETTINGS_MODULE project.settings 
PythonDebug On 
PythonOption django.root /my/project 
PythonPath "['/www/host1/htdocs/my/project'] + sys.path"

I suppose my site should be accessible from http://host1/my/project, but I see the following error:

ImportError: Could not import settings 'project.settings' (Is it on sys.path? Does it have syntax errors?): No module named project.settings

Can somebody give any suggestions?

2 Answers 2

2

Use:

PythonPath "['/www/host1/htdocs/my', '/www/host1/htdocs/my/project'] + sys.path"

Ie.. parent and project folder.

Also ensure Apache user has rights to read stuff in your directories and write where appropriate.

Sign up to request clarification or add additional context in comments.

Comments

0

My Conf file has the following lines:

SetHandler python-program
PythonPath "['c:/projectparentdir']+sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE project.settings
PythonOption django.root /project
PythonDebug On

The only difference I can see is that my python path points to the projects parent directory.

After using Django for a while with mod_python I am very keen to try out mod_wsgi, apparently a much more robust method.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.