Hi All i am not able to run a django application in apache2 webserver. I have went through all the document but it still did not work for me.This is my Apache2’s httpd.conf file
<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonOption django.root /mysite
PythonPath "['/home/djangotest/mysite'] + sys.path"
PythonDebug On
</Location>
My django project location is at /home/djangotest/mysite in which i am running the polls application. Is there something i have to mention in settings.py or urls.py for this to work in apache2 it works fine in the dev server. or is there configuration i have to do in apache2 to work
Try to add ‘/home/djangotest’ to PythonPath:
You need to add that if you import your project’s files with the syntax ..
The other guys here are right, though; switch to mod-wsgi if you can. Django’s mod_python support will be deprecated very soon. http://docs.djangoproject.com/en/1.2/howto/deployment/modpython/
edit: mod_python support is deprecated in Django 1.3, and will be removed entirely on Django 1.5.