1 #!/usr/bin/env python 2 3 # NOTE: Path manipulation requires manual customisation. 4 5 import sys 6 sys.path.append("/home/paulb/Software/Python/WebStack") 7 sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") 8 9 from WebStack.Adapters import ModPython 10 from WebStack.Resources.Login import LoginResource, LoginAuthenticator 11 12 # NOTE: Not sure if the resource should be maintained in a resource pool. 13 14 resource = LoginResource( 15 LoginAuthenticator( 16 secret_key="horses", 17 credentials=( 18 ("badger", "abc"), 19 ("vole", "xyz"), 20 ) 21 ), 22 use_redirect=0 23 ) 24 25 def handler(req): 26 global resource 27 return ModPython.respond(req, resource, handle_errors=0) 28 29 # vim: tabstop=4 expandtab shiftwidth=4