[mod_python] req.connection.user generates AttributeError

Glenn A. Hochberg gah at research.att.com
Sun Oct 19 22:24:11 EST 2003


> I'm new to mod_python, and I'm stuck already.  I'm working through the
> examples in the documentation, and even after careful typing (and cutting
> and pasting from the manual), I can't get the authentication example to
> work.  The line:
> 
> 	user = req.connection.user
> 
> Gives an attribute error ('user').  As shown in the manual, I'm calling
> req.get_basic_auth_pw() first, but still no joy.

I ran into this too.  The documentation is wrong; you should use req.user instead.  Also note that you *can* assign a value to req.user -- it's not read-only as listed in the docs.

-Glenn Hochberg





More information about the Mod_python mailing list