[mod_python] cg-bin files execution

François py at topmusic.ch
Fri Dec 3 05:54:05 EST 2004


> Well i enter that url http://myserver/mptest.py/handler
> And i received the following
>
> Hello World!HTTP/1.1 200 OK
> Date: Thu, 02 Dec 2004 21:31:42 GMT
(...)

It's OK. With mod_python.publisher the return parameter is the text you want
to display :

Good:
#test.py
def good-function(req):
	return "<html><body>My Text</body></html>"

http://mysite/test.py/good-function
will display 'My Text'

Bad:
#test.py
def bad-function(req):
	req.write("<html><body>My Text</body></html>")
	return apache.OK

http://mysite/test.py/bad-function
will display 'My Text' + your error message

François



More information about the Mod_python mailing list