1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/examples/ModPython/LoginApp/LoginHandler.py Sat May 29 23:07:08 2004 +0000
1.3 @@ -0,0 +1,29 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +# NOTE: Path manipulation requires manual customisation.
1.7 +
1.8 +import sys
1.9 +sys.path.append("/home/paulb/Software/Python/WebStack")
1.10 +sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common")
1.11 +
1.12 +from WebStack.Adapters import ModPython
1.13 +from Login import LoginResource, LoginAuthenticator
1.14 +
1.15 +# NOTE: Not sure if the resource should be maintained in a resource pool.
1.16 +
1.17 +resource = LoginResource(
1.18 + LoginAuthenticator(
1.19 + secret_key="horses",
1.20 + credentials=(
1.21 + ("badger", "abc"),
1.22 + ("vole", "xyz"),
1.23 + )
1.24 + ),
1.25 + use_redirect=0
1.26 +)
1.27 +
1.28 +def handler(req):
1.29 + global resource
1.30 + return ModPython.respond(req, resource, debug=1)
1.31 +
1.32 +# vim: tabstop=4 expandtab shiftwidth=4