[mod_python] CGI Environment Specs

Yandle, Hans Hans.Yandle at cingular.com
Tue May 21 10:42:11 EST 2002

I am looking into the possibility of using mod_python to accelerate and/or
replace some of my cgi scripts. However, I lack one last detail before I can
attempt this task. One of my cgi scripts uses the HTTP_REFERER environment
variable. After reading the docs, I made the following script using the
mod_python.publisher handler:

from mod_python import apache

def commonenv(req):
    req.content_type = "text/html"
    s = """<html><head><title>Mod_Python Common Environment
    for parameter in req.subprocess_env.keys():
        s = s + "<tr><td>%s</td><td>%s</td></tr>" % (parameter,
    s = s + "</table></p></body></html>"
    return s

When it is executed, the HTTP_REFERER variable is missing. If anyone knows
how to accomplish this, I would be grateful.


More information about the Mod_python mailing list