On Jun 5, 4:28 pm, Marco Aloisio <firstname.lastname@example.org> wrote:
Have a look at paste (http://pythonpaste.org/).
> Hi, I'm a Python newbie;
> I have to write a simple webserver, and I need to
> implement a basic authentication as specified in the RFC2617.
> I wonder if there is a Python library for doing that.
> Marco Aloisio
For instance, to enable authentication for user foo, you can do the
from paste.auth.basic import AuthBasicHandler
def only_for_foo(env, user, passwd):
return user == 'foo' and passwd = 'bar'
auth_app = AuthBasicHandler(
myapp, 'app realm', only_for_foo)
(where myapp is your WSGI application, of course).