2004-02-08 | paulb | file changeset files shortlog | [project @ 2004-02-08 21:42:57 by paulb] Added the authentication/authorisation example for BaseHTTPRequestHandler. |
paulb@53 | 1 | #!/usr/bin/env python |
paulb@53 | 2 | |
paulb@53 | 3 | from WebStack.Adapters import BaseHTTPRequestHandler |
paulb@53 | 4 | from Auth import AuthResource |
paulb@53 | 5 | import BaseHTTPServer |
paulb@53 | 6 | |
paulb@53 | 7 | # Special magic incantation. |
paulb@53 | 8 | |
paulb@53 | 9 | handler = BaseHTTPRequestHandler.HandlerFactory(AuthResource()) |
paulb@53 | 10 | address = ("", 8080) |
paulb@53 | 11 | server = BaseHTTPServer.HTTPServer(address, handler) |
paulb@53 | 12 | server.serve_forever() |
paulb@53 | 13 | |
paulb@53 | 14 | # vim: tabstop=4 expandtab shiftwidth=4 |