djangoapachedeploymenthttpd.conf

Have problem with deploying django using apache


Hello I am having a problem with Django trying to get it deployed on a server using apache. for some reason when I write this information in my httpd.conf file.

<location "/mysite">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE mysite.settings
    PythonOption django.root /mysite
    PythonDebug off
    PythonPath "['/user/local/src/djcode','/user/local/src/djcode/mysite'] + sys.path"
</Location>

I get this error when I restart apache.

Syntax error on line 3 of /etc/apache2/httpd.conf:
Invalid command 'PythonHandler', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.

Any ideas?


Solution

  • this error is pretty much self explanatory (second line is important to you):

    Invalid command 'PythonHandler', perhaps misspelled 
    or defined by a module not included in the server configuration
    

    PythonHandler is a command unknown by apache. It's a "module command" known by mod_python. So if missing it says invalid command (OR defined by module not in...).

    So make sure mod_python is installed.

    You might know it anyways, but just follow this document http://docs.djangoproject.com/en/dev/howto/deployment/modpython/