My project is under: /home/projects/testing and I am adding this towards the buttom of my /etc/httpd/conf/httpd.conf file on Centos machine, but that's no longer working,

<Location "/testing/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE testing.settings
    PythonOption django.root /testing
    PythonDebug On
    PythonPath "['/home/projects/'] + sys.path"
</Location>

however when asking for http://localhost/testing/jobs for instance, I recieve:


Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (newest call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch

    result = object(req)

.............

 File "/usr/lib/python2.4/site-packages/Django-1.1.1-py2.4.egg/django/conf/__init__.py", line 75, in __init__

    raise ImportError, "Couldn't import configurations '%s' (Could it be on sys.path? Is there syntax errors?): %s" % (self.Configurations_MODULE, e)

ImportError: Couldn't import configurations 'testing.settings' (Could it be on sys.path? Is there syntax errors?): No module named testing.configurations

You would like both, the projects folder and also the testing folder inside your PythonPath, because any project uses pathways with no "testing" inside it:

PythonPath "['/home/projects/', '/home/projects/testing/'] + sys.path"

The road looks okay in my experience, I have just double checked that products in sys.path use trailing slashes.

I'd claim that this can be a file permissions problem:

  • Does the consumer apache is running under have the project files?
  • Is selinux stopping access?