[mod_python] REMOTE_USER key error question

Prashanth prashanth.dumpuri at vanderbilt.edu
Tue Apr 17 18:32:45 EDT 2007


All,

I'm trying to pick up REMOTE_USER from os.environ['REMOTE_USER'] and I 
get a key error as shown below:

------------------------------------------------------------------------------------------------------------------------------------------------------------
Mod_python error: "PythonHandler test"
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, 
in HandlerDispatch
result = object(req)
File "/var/www/modelweb/restricted/test.py", line 17, in handler
req.write(os.environ['REMOTE_USER'])
KeyError: 'REMOTE_USER'

---------------------------------------------------------------------------------------------------------------------------------------------------------------
Using cgi.print_environ() returns nothing. I'm using apache 2 (and 
htpasswd), so I know REMOTE USER must be set.

Here's my directory structure:

index.html  in /var/www/modelweb - that challenges the user with a login 
prompt
test.py in /var/www/modelweb/restricted - that executes (or it's 
supposed to) if the user's login is successful.

Can someone help me figure out what's going on here ? Any help in this 
regard will be greatly appreciated.
Prashanth





More information about the Mod_python mailing list