[mod_python] CGI Environment Specs

Sam Brauer sam at webslingerZ.com
Tue May 21 13:25:17 EST 2002

Did you hit the script directly (by typing the location into your 
browser)?  If so, that variable won't be set.
Try creating a test html page with a link to your script, then hit the 
script by following the link.  In that case, the variable should contain 
the url of your test html page.

- Sam

Sam Brauer
Systems Programmer
sam at webslingerZ.com

On Tue, 21 May 2002, Yandle, Hans wrote:

> 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"
>     req.send_http_header()
>     req.add_common_vars()
>     s = """<html><head><title>Mod_Python Common Environment
> Variables</title></head>
>            <body><p
> align=center><table><tr><td>Parameter</td><td>Value</td></tr>"""
>     for parameter in req.subprocess_env.keys():
>         s = s + "<tr><td>%s</td><td>%s</td></tr>" % (parameter,
> req.subprocess_env[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.
> Hans
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list