[mod_python] REMOTE_ADDR

Mark Constable markc at renta.net
Mon Nov 19 00:38:23 EST 2001


I'm sure this worked for me a few days ago (maybe
I was imaginging it and some rotuine nearby happened
to be working);

 if req._req.subprocess_env.has_key("REMOTE_ADDR"):
   rn = req._req.subprocess_env["REMOTE_ADDR"]

but now the above test is failing and when I try to
see where REMOTE_ADDR has gone I get these results...

 for k in req._req.subprocess_env.keys():
   e.write(k+"\n")

UNIQUE_ID
WE_HAVE_REWRITE
UNIQUE_ID
WE_HAVE_REWRITE
GATEWAY_INTERFACE
SERVER_PROTOCOL
REQUEST_METHOD
QUERY_STRING
REQUEST_URI
SCRIPT_NAME
PATH_INFO
PATH_TRANSLATED

Is it possible that REMOTE_ADDR has been somehow
over written by the duplication of UNIQUE_ID and
WE_HAVE_REWRITE ?

I'm a python and mod_python novice so maybe my
question should be simply "how do I find REMOTE_ADDR
under mod_python" ?

--markc



More information about the Mod_python mailing list