[mod_python] mod_python only returns 404 error's

Jorey Bump list at joreybump.com
Sun Nov 5 15:23:10 EST 2006


Cryptronic wrote:
> Hi all,
> 
> i tried to use mod_python, installation from .deb works fine.
> 
> I'm running following configuration:
> Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4c0
> 
> then i tried to following skript:
> 
>  from mod_python import apache
> 
>  def handler(req):
>      req.content_type = "text/plain"
>      req.write("Hello World! Blarg!")
>      return apache.OK
> 
> 
> with rights: 755 owned by the suexec user
> 
> with the following vhost config:
> 
>       AddHandler python-program .py
>       PythonHandler mod_python.publisher
>       PythonDebug On
> 
> when i open the url in browser errlog shows me:
> [notice] mod_python: (Re)importing module 'mod_python.publisher'
> [notice] [client] Publisher loading page /var/www/test/test2.py
> 
> But i got in the browser only a 404 page -  no error's  in log - nothing :(

You are not using Publisher correctly. Create a file named hello.py:

def bruce(req):
     return "Hello, Bruce!"

Now point your browser at the *function* in the module:

http://host/hello.py/bruce




More information about the Mod_python mailing list