# HG changeset patch # User paulb # Date 1076276601 0 # Node ID e92889fe433ab2effb0b1e39b3500ad0832e40a1 # Parent 31814646dc1f409dae26af805b387b68761ee5e4 [project @ 2004-02-08 21:43:21 by paulb] Added the authentication/authorisation example for mod_python. diff -r 31814646dc1f -r e92889fe433a examples/ModPython/AuthApp/AuthHandler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/ModPython/AuthApp/AuthHandler.py Sun Feb 08 21:43:21 2004 +0000 @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +# NOTE: Path manipulation requires manual customisation. + +import sys +sys.path.append("/home/paulb/Software/Python/WebStack") +sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters import ModPython +from Auth import AuthResource + +# NOTE: Not sure if the resource should be maintained in a resource pool. + +resource = AuthResource() + +def handler(req): + global resource + return ModPython.dispatch(req, resource, debug=1) + +# vim: tabstop=4 expandtab shiftwidth=4