1 #!/usr/bin/env python 2 3 from WebStack.Adapters import BaseHTTPRequestHandler 4 from Login import LoginResource, LoginAuthenticator 5 import BaseHTTPServer 6 7 # Special magic incantation. 8 9 handler = BaseHTTPRequestHandler.HandlerFactory( 10 LoginResource( 11 LoginAuthenticator( 12 secret_key="horses", 13 credentials=( 14 ("badger", "abc"), 15 ("vole", "xyz"), 16 ) 17 ), 18 anonymous_parameter_name="anonymous" 19 ) 20 ) 21 address = ("", 8081) 22 server = BaseHTTPServer.HTTPServer(address, handler) 23 print "Serving..." 24 server.serve_forever() 25 26 # vim: tabstop=4 expandtab shiftwidth=4