[mod_python] Simulating non parsed header scripts

Markus Demleitner msdemlei at cl.uni-heidelberg.de
Wed Apr 17 10:33:51 EST 2002


Hi,

The FAQ states that a redirection should be done this way:

 req.headers_out['location'] = 'http://www.modpython.org/'  
     req.status = apache.HTTP_MOVED_TEMPORARILY
     req.send_http_header()
     return apache.OK

Unfortunately, I couldn't find status in the docs, and so
I'm a bit uncertain what else I can do with status.
Basically, I want to port an nph-script, so is it ok
to set status to whatever I want in the server's response 
line (500, 302, 200, whatever) and then return apache.OK?

Also, my classes generate "`raw"' http result codes (instead
of symbolic names from the apache module).  I like it this
way, because I can use them with or without mod_python.  Is
there any danger in assigning those to req.status?

Minor gripes: The link to the complete mailing list archive
is dead, and in the docs for 5.1.9 PythonHandler, a % in the
TeX source is missing a backslash.

Cheers,

        Markus



More information about the Mod_python mailing list