[mod_python] writting a handler in python

Alejandro Mery amery at geeks.cl
Thu Jun 30 16:10:22 EDT 2005


> Reading the documentation on the mod_python site would be a good start.
> 
>   http://www.modpython.org
> 

:-)

i haven't found anything about on python-program on mod_python manual 
3.1.3, i guess i should re-reading (on print) carefully but i need to 
buy ink and paper before.

> Having done that, then try and work out what the following does:
> 
>   # .htaccess file
> 
>   AddHandler python-program .foo
>   PythonHandler mod_foo
>   PythonDebug On
> 
>   # mod_foo.py file
> 
>   from mod_python import apache
> 
>   def handler(req):
>     req.content_type = "text/plain"
>     req.send_http_header()
>     req.write("uri = %s"%req.uri)
>     return apache.OK
> 
> Graham

my last question, how would that be to have mod_foo handling .foo and 
mod_bar handling .bar

the changes i have tried always end on an error :-\

please :)

Alejandro


More information about the Mod_python mailing list