mod_python

Python_it python_it at hotmail.com
Tue Oct 11 09:42:37 CEST 2005


Today I was busy to install mod_python.

I have put the line

LoadModule python_module libexec/mod_python.so

into the httpd.conf file.
It Works!
Apache load mod_python /3.2.2.b Python2.4

But my problem is where I have to place te following code in de
httpd.conf?

    <Directory C:\Program Files\Apache Group\Apache2\htdocs\project\>
        AddHandler mod_python .py
        PythonHandler mptest
        PythonDebug On
    </Directory>

Because al the tutorials write this. But where?

If I try to put the code some where,
apache give the following message by testing the configure:
Multiple <Directory> arguments not (yet) supported
But what i have to change or replace.

I test with the next file:

C:\Program Files\Apache Group\Apache2\htdocs\project\
mptest.py

from mod_python import apache

def handler(req):
   req.content_type = 'text/plain'
   req.send_http_header()
   req.write('mptest.py\n')
   return apache.OK

Is this code enough for testing?




More information about the Python-list mailing list