[mod_python] Re: Mod_python Digest, Vol 10, Issue 15

Glenn A. Hochberg gah at research.att.com
Tue Jan 13 11:44:28 EST 2004

REMOTE_ADDR is available as req.connection.remote_ip, SCRIPT_NAME as req.filename.

Actually, one CGI env. var. that I have not been able to find via mod_python is HTTPS (set to "on" when using SSL).  

Is there some way to determine whether your baseurl should start with https: versus http:?  I'm trying to pass my full URL to another site via a redirect; I can find out everything I need except for that.


On Mon, 12 Jan 2004 15:36:42 -0600, Edwin Grubbs wrote:

> On Sun, Jan 11, 2004 at 11:27:12PM -0500, Gregory (Grisha) Trubetskoy wrote:

>> On Sun, 11 Jan 2004, Edwin Grubbs wrote:
>>> > The objective is to access the environment variables that are unique to
>>> > each request such as REMOTE_ADDR, HTTP_USER_AGENT, and our own cookies
>>> > such as SESSION_COOKIE.
>>> >
>> Hmm... This may be a bug somehwere, I'll have to take a look at it. But,
>> all of this information is available directly without having to use
>> subprocess_env, as part of the request object or req.headers_in.
>> Subprocess_env is an inefficient way of doing it since it is artificially
>> constructed from the same sources to which mod_python allows you direct
>> access.
>> Grisha

> The req.headers_in variable does not contain the REMOTE_ADDR or the
> SCRIPT_NAME variables which can not be passed in using PythonOption.
> -Edwin

More information about the Mod_python mailing list