[mod_python] psp_site example doesn't work

Zach White zwhite-mod_python at darkstar.frop.org
Sun Jan 23 02:28:54 EST 2005


On Sun, Jan 23, 2005 at 05:47:41PM +1100, Graham Dumpleton wrote:
> Since configuration in httpd.conf file as opposed to .htaccess, I assume
> that Apache was restarted?

Yes, I've restarted apache many times, using 'apachectl stop && apachectl 
start'. I've also removed the .htaccess that comes with psp_site so that's 
not in the picture.

> After restarting Apache, when you try and access the file which you 
> expect
> to be managed by the mod_python.publisher handler, do you see a line 
> appear
> in the Apache error log file of the form?

(Read your post about the mailing list archives, and found that the problem
wasn't google not indexing it, but that I had searched for 'psp psp_site
publisher' which appearantly has no results. Mea culpa.)

I do not see that in the error log. In fact, I don't see anything in the 
error log, unless I try going to any of the following combinations:

http://beta.rvmotel.com/index
http://beta.rvmotel.com/index.py/index
http://beta.rvmotel.com/index.py/home

And then it's just a file not found error.

In reading through the archives on anything that seemed to relate to my
problem, I switched from SetHandler to:

    AddHandler python-program .py

And now mod_python seems to be parsing pages, but not really how I'd like.
If I goto index/index, I get a cannot import psp error, but at least
mod_python works now. So I throw up a hello.py:

def index():
        return 'Hello there!'

http://beta.rvmotel.com/hello.py
68.186.66.XXX - - [23/Jan/2005:07:15:47 +0000] "GET /hello.py HTTP/1.1" 404 334 "-" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.34"

Notice the 404 error, but nothing in error_log.

http://beta.rvmotel.com/hello.py/index
[Sun Jan 23 07:17:23 2005] [notice] mod_python: (Re)importing hello from ['/var/www/rvmotel-beta']

So, I have it most of the way there to being able to develop. But I can't
seem to get publisher to run the index() function like all the docs I've come
across say I can. I also can not get it to treat index.py as the directory
index. This means I need to use something like an index.html with a meta
refresh, which I'd like to avoid if at all possible.

So, some progress, but ever more questions. Why does AddHandler work, but
the SetHandler that the docs say to use doesn't? Why can't I get it to
process index.py or the index() function?

Thanks for your help.

-Zach


More information about the Mod_python mailing list