[mod_python] 404 error on existing file

Graham Dumpleton graham.dumpleton at gmail.com
Thu Jun 19 04:43:30 EDT 2008


Read documentation again.

You are trying to use a standard mod_python handler code with higher
level publisher handler mechanism. You can't do that they are two
distinct things and have different ways of doing things.

Also use Google to search for 'mod_python tutorial' and read the
tutorial you find.

Graham

2008/6/19 Andre Hübner <andre.huebner at gmx.de>:
> Hi List,
>
> it is my first posting to mod_python mailinglist.
> I successfully solved problem with " make_obcallback: could not import
> mod_python.apache" using faq but now i need your help.
> .so File was ok, but i forgot to put *py Files to site-packages/mod_python
> ;)
>
> mod_python seems to run now.
> http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.006.htp  shows what
> i try.
> I activated in httpd.conf:
>
> <Location "/py/">
>   AddHandler mod_python .py
>   PythonHandler mod_python.publisher
>   PythonDebug On
> </Location>
>
> My File in $document-root/py/test.py:
>
> from mod_python import apache
>
> def handler(req):
>   req.content_type = "text/plain"
>   req.send_http_header()
>   req.write("Hello World! Blarg!")
>   return apache.OK
>
> If I call this file i got apache-error 404, but called file is existing.  in
> Apache errorlog i see:
>
> [Thu Jun 19 09:40:31 2008] [notice] mod_python (pid=18650,
> interpreter=example.com'): Importing module '/path/path/py/test.py'
>
> If i change code of test.py to make syntaxerror without changing
> apache-setup i see in errorlog and browser the message about syntaxerror.
> I cannot explain this 404 when using correct code. I just want to see "hello
> world" in browser.
>
> I use apache 2.2.9 and mod_python 3.3.1
> What could be the problem? I hope there is somebody with experience in this
> case.
>
> Thank you
> Andre
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>



More information about the Mod_python mailing list