Re: Re: pyblosxom1.2 + mod_python/2.7.10 on apache 1.3.33
Steven Armstrong <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
On 03/28/05 12:52, Pasi Savolainen wrote: > * Steven Armstrong <[email protected]>: >> >> Do you have other mod_python scripts that work in your setup? >> Maybe write a simple handler that sets some headers and writes a Hello >> World or something to check if your installation basically works? > > Did that now and noticed that it also lacks header output. Apparently > mod_python for apache 1.3 needs send_http_header() called. I've not > checked but this behaviour applies when using directive > PythonHandler test::handler > > - test.py - > # 'really' minimal HTTP handler > from mod_python import apache > > def handler(req): > req.content_type = "text/plain" > req.send_http_header() > req.write( "1, 2, 3") > return apache.OK > - - > >> One guess would be that something goes wrong in the method >> 'ModPythonHandler send_headers' in mp_wsgi_handler.py. Maybe for some >> reason it doesn't get called? > > I had already poked at it and saw that headers _were_ being generated > (using this kind of 'debug': print >> file('/tmp/pbdeb', 'a'), "--sr: ", self.request ...) > Some part in newer mod_python calls the header flushing function, but > in older mod_python that needs to be explicit. > > Many thanks for nudging me into right direction. > I very much like the added performance over plain perl blosxom. My > pageload has dropped from 3s to 0.5s, and blosxom has most of content > cached. > I think I'll be giving to couple of blosxom plugins some python lovin' > and try to convert my site over to pyblosxom. > > Inlined is patch needed to make pyblosxom/mp_wsgi_handler runnable under > mod_python/2.7. I have step-by-step instructions written, but they do > get quite hairy with need to separate server-side-view and clientside > view. I'd say managing apache would get a lot easier with partial > unification of these. > Glad you got it to work, and thanks for the patch. I'll try to integrate your patch and rewrite my handler to work for both versions. cheers Steven ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click