[mod_python] req.connection.user generates AttributeError

Hancock, David (DHANCOCK) DHANCOCK at arinc.com
Sun Oct 19 00:27:02 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.

If I try/except to trap the attribute error, I avoid the 500 Server Error
message, but the authentication still doesn't work.

Any ideas?  I'm running Windows 2000, Apache 2.0.47, Python 2.2, and
mod_python 3.0.3.  (My other computer is a Linux box, but this is what I've
got right going right now).  The mod_python is a precompiled binary.

I'll be grateful for any assistance I can get.  I'm trying to recreate a
mod_perl module (AuthCookie) which implements a ticket-based authentication
mechanism.  It works well in Perl, but my group standardized on Python and
we'd like to keep using Python for Apache modules, too.

David Hancock | dhancock at arinc.com | 410-266-4384

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.modpython.org/pipermail/mod_python/attachments/20031019/4a6519b3/attachment-0003.htm

More information about the Mod_python mailing list