[mod_python] Setup apache for customized .py files to use mod_python ?

Huzaifa Tapal huzaifa at hostway.com
Wed May 4 16:12:49 EDT 2005

By adding that directory block to your httpd.conf, you are specifying 
the http handler for any requests that come in for any .py files in the 
directory "test".  it is your handler "mptest" or any that you specify 
as the PythonHandler that needs to load and return the results from the 
actual script that was requested.

mod_python provides a couple of handlers, cgihandler and publisher, that 
you can use that do the mapping to your script based on the URI, 
however, you may have to update your scripts to support these handlers.  
cgihandler in my opinion would be your best bet.


py pan wrote:

>The documentation of mod_python says to put the following into the
>http.conf of apache:
><Directory "c:/apache/Apache2/htdocs/test">
>        AddHandler mod_python .py
>        PythonHandler mptest
>        PythonDebug On
>    </Directory>
>It seems to me that if I want to make use of this configuration, I
>will have to name my py file to mptest.py. That will make this
>configuration serves only one file. I did check and see that only
>mptest.py works.
>How can I setup the apache such that any *.py file in that folder works?
>Mod_python mailing list
>Mod_python at modpython.org

More information about the Mod_python mailing list