Newbie Question

Robey Holderith robey at flaminglunchbox.net
Wed Feb 2 01:31:06 EST 2005


On Tue, 01 Feb 2005 17:47:39 -0800, Joel Eusebio wrote:

> 
> Hi Everybody,
> 
> I'm pretty new to Python and would like to ask a few questions. I have this
> setup on a Fedora Core 3 box.
> 
> Python 2.3.4
> wxPython-common-gtk-ansi-2.5.3.1-fc2_py2.3
> mod_python-3.1.3-5
> Apache/2.0.52
> 
> I have a test.py which looks like this:
> from mod_python import apache
> def handler(req):
>        req.write("Hello World!")
>        return apache.OK
> 

This code looks like you are attempting to define a handler.  In this case
the handler needs to be properly set up in either your httpd.conf or a
.htaccess (assuming your configuration allows for that).

> Whenever I access test.py from my browser it says "The page cannot be found"
> , I have the file on /var/www/html, what did I miss?

You don't access handlers like you do CGI.  This problem likely lies in
your configuration and not in your code.  I would look at mod_python's
documentation some more and probably start with mod_python's
PublisherHandler for initial testing and experimentation.

-Robey Holderith

>  Thanks in advance,
> Joel





More information about the Python-list mailing list