2004-09-21 | paulb | file changeset files shortlog | [project @ 2004-09-21 18:05:14 by paulb] Updated the description. Added to the release notes. |
paulb@125 | 1 | #!/usr/bin/env python |
paulb@125 | 2 | |
paulb@125 | 3 | from WebStack.Adapters import BaseHTTPRequestHandler |
paulb@156 | 4 | from WebStack.Resources.Login import LoginResource, LoginAuthenticator |
paulb@125 | 5 | import BaseHTTPServer |
paulb@125 | 6 | |
paulb@125 | 7 | # Special magic incantation. |
paulb@125 | 8 | |
paulb@125 | 9 | handler = BaseHTTPRequestHandler.HandlerFactory( |
paulb@129 | 10 | LoginResource( |
paulb@129 | 11 | LoginAuthenticator( |
paulb@129 | 12 | secret_key="horses", |
paulb@129 | 13 | credentials=( |
paulb@129 | 14 | ("badger", "abc"), |
paulb@129 | 15 | ("vole", "xyz"), |
paulb@129 | 16 | ) |
paulb@150 | 17 | ) |
paulb@129 | 18 | ) |
paulb@125 | 19 | ) |
paulb@125 | 20 | address = ("", 8081) |
paulb@125 | 21 | server = BaseHTTPServer.HTTPServer(address, handler) |
paulb@129 | 22 | print "Serving..." |
paulb@125 | 23 | server.serve_forever() |
paulb@125 | 24 | |
paulb@125 | 25 | # vim: tabstop=4 expandtab shiftwidth=4 |