WebStack

examples/ModPython/SimpleWithLoginApp/SimpleWithLoginHandler.py

752:7a9ee094a4b7
2008-02-02 paulb [project @ 2008-02-02 23:35:36 by paulb] Removed local default encoding attributes. Improved the SimpleMap resource documentation and initialisation features.
     1 #!/usr/bin/env python     2      3 # NOTE: Path manipulation may require manual customisation.     4      5 import sys, os     6 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common")))     7      8 from WebStack.Adapters.ModPython import deploy     9 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator    10 from Simple import SimpleResource    11     12 # NOTE: Not sure if the resource should be maintained in a resource pool.    13     14 resource = LoginRedirectResource(    15     login_url="http://localhost/login/app",    16     app_url="http://localhost",    17     resource=SimpleResource(),    18     authenticator=LoginRedirectAuthenticator(secret_key="horses"),    19     anonymous_parameter_name="anonymous",    20     logout_parameter_name="logout",    21     use_logout_redirect=0    22 )    23     24 handler, _no_authentication = deploy(resource, handle_errors=0)    25     26 # vim: tabstop=4 expandtab shiftwidth=4