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 Auth import AuthResource, AuthAuthenticator 11 12 # NOTE: Not sure if the resource should be maintained in a resource pool. 13 14 resource = AuthResource() 15 authenticator = AuthAuthenticator() 16 17 def handler(req): 18 global resource 19 return ModPython.respond(req, resource, handle_errors=0) 20 21 def authenhandler(req): 22 global authenticator 23 return ModPython.authenticate(req, authenticator, handle_errors=0) 24 25 # vim: tabstop=4 expandtab shiftwidth=4