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 Simple import SimpleResource 11 from LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator 12 13 # NOTE: Not sure if the resource should be maintained in a resource pool. 14 15 resource = LoginRedirectResource( 16 login_url="http://localhost/login/app.login", 17 app_url="http://localhost", 18 resource=SimpleResource(), 19 authenticator=LoginRedirectAuthenticator(secret_key="horses"), 20 anonymous_parameter_name="anonymous" 21 ) 22 23 def handler(req): 24 global resource 25 return ModPython.respond(req, resource, debug=1) 26 27 # vim: tabstop=4 expandtab shiftwidth=4