Why do I get error, Invalid command 'PythonHandler'?

Posted by nbolton on Server Fault See other posts from Server Fault or by nbolton
Published on 2009-08-23T01:09:24Z Indexed on 2010/03/17 3:21 UTC
Read the original article Hit count: 607

Filed under:
|
|
|

I'm trying to deploy a Django application, but I've hit a brick wall. On Debian (latest), I've run these commands so far:

apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-python python-django

I've tried adding the module manually in the Apache 2 config files, but to be honest I'm totally lost. It's totally different to Apache version 1 which I used years ago.

Syntax error on line 7 of /etc/apache2/sites-enabled/000-default:
Invalid command 'PythonHandler', perhaps misspelled or defined by a module not included in the server configuration

I've added the following to my sites-available/default file, between the tags.

    <Location "/">
              SetHandler python-program
              PythonHandler django.core.handlers.modpython
              SetEnv DJANGO_SETTINGS_MODULE hellodjango1.settings
              PythonDebug Off
    </Location>

Here's what tutorials I've used so far, without much luck:

© Server Fault or respective owner

Related posts about django

Related posts about apache