1 #!/usr/bin/env python 2 3 # Uncomment and adjust the paths below if WebStack is not installed somewhere 4 # on the PYTHONPATH. 5 6 #import sys 7 #sys.path.append("/home/paulb/Software/Python/WebStack") 8 #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") 9 10 from WebStack.Adapters.WSGI import deploy_as_cgi 11 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator 12 from WebStack.Resources.Login import LoginResource, LoginAuthenticator 13 from WebStack.Resources.ResourceMap import MapResource 14 from Simple import SimpleResource 15 16 deploy_as_cgi( 17 MapResource({ 18 "simple" : 19 LoginRedirectResource( 20 login_url="http://localhost/wsgi/login", 21 app_url="http://localhost", 22 resource=SimpleResource(), 23 authenticator=LoginRedirectAuthenticator(secret_key="horses"), 24 anonymous_parameter_name="anonymous", 25 logout_parameter_name="logout" 26 ), 27 "login" : 28 LoginResource( 29 LoginAuthenticator( 30 secret_key="horses", 31 credentials=( 32 ("badger", "abc"), 33 ("vole", "xyz"), 34 ) 35 ) 36 ) 37 }), 38 handle_errors=0 39 ) 40 41 # vim: tabstop=4 expandtab shiftwidth=4