views:

26

answers:

1

Hey,

I need to deploy my Django application on my apache server, I've added the following to my httpd.conf:

<Location "/dashboard/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    PythonPath "['/home/firas/project/trunk/dashboard/analytics','/home/firas/project/trunk/dashboard', '/home/firas/project/trunk'] + sys.path"
    SetEnv DJANGO_SETTINGS_MODULE dashboard.settings
    PythonOption django.root /dashboard
    PythonDebug On
</Location>

I am getting the following error when requesting my app:

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

My settings.py has no syntax errors.

Any clue ?

+1  A: 

if you want apache to see dashboard.settings, the PythonPath should end at "project/trunk".

You can use either

PythonPath "['/home/firas/project/trunk'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE dashboard.settings

or

PythonPath "['/home/firas/project/trunk/dashboard/analytics','/home/firas/project/trunk/dashboard', '/home/firas/project/trunk'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE settings

The first one is better, IMO.

btbytes
It doesn't work, I am getting the same error.
Firas