[SPAM] Re: [SPAM] [mod_python] [SPAM] New to mod_python, basic mod_python.publisher question

Graham Dumpleton graham.dumpleton at gmail.com
Sun Jul 27 02:40:48 EDT 2008


2008/7/27 dave selby <dave6502 at googlemail.com>:
> I have a file test.py (ok not so original) containing ....
>
> #!/usr/bin/env python
>
> from mod_python import apache
>
> def handler(req):
>    req.content_type = 'text/plain'
>    req.write("Hello World!")
>    return apache.OK
>
> When I add the following to my vhost and access with it with a URL of
> http://localhost:8085/test/ it works as expected ...
>
> AddHandler mod_python .py
> PythonHandler test
> PythonDebug On
>
> However I need mod_python.publisher so I substitute the above for ...
>
> AddHandler mod_python .py
> PythonHandler mod_python.publisher
> PythonDebug On
>
> And access with it with a URL of http://localhost:8085/test/ and I get
> 'The requested URL /test.py/ was not found on this server.'
>
> Can anyone tell me what I am doing wrong ?

Yes, you aren't reading/interpreting the documentation properly. When
using mod_python.publisher, the entry point isn't necessarily called
handler() and doesn't follow the same calling semantics as basic
mod_python handler.

Thus, read the documentation on mod_python site again and also perhaps
read publisher tutorial at:

  http://webpython.codepoint.net/mod_python

Graham


More information about the Mod_python mailing list