[mod_python] REMOTE_USER key error question

Sean Davis sdavis2 at mail.nih.gov
Tue Apr 17 18:51:32 EDT 2007


Prashanth wrote:
> 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.
See here:

http://www.modpython.org/live/current/doc-html/tut-more-complicated.html

Sean


More information about the Mod_python mailing list