[mod_python] using req object with Publisher

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Jun 24 11:50:40 EDT 2004

Certainly, why not? And I think it will work just fine without the raise 
statement at the end.

Also, unless you're on Apache 1.3, the send_http_header() does nothing, so 
you probably don't need it either.


On Tue, 15 Jun 2004, Mark Nye wrote:

> Quick question from a newbie modpython user...
> Suppose I'm using Publisher to read GET or POST data, but would like to
> begin writing back to the browser immediately instead of collecting my
> entire page output in a string and returning it all at the end. (Maybe
> I'm looping through a long db result set, for example.) Does it make
> sense to do something like this:
> from mod_python import apache
> def myhandler(req, myvar1=None, myvar2=None):
> 	req.content_type = "text/html"
> 	req.send_http_header()
> 	req.write("my html") # of course I'd be doing more here
> 	raise apache.SERVER_RETURN, apache.OK
> 	return
> Or would anyone suggest a different approach? Thanks!
> Mark
> _______________________________________________
> 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