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.CGI import deploy 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( 17 MapResource({ 18 "simple" : 19 LoginRedirectResource( 20 login_url="http://localhost/cgi/login", # Change this to be the exact URL on your server. 21 # eg. http://localhost:8000/cgi/LoginHandler.py 22 app_url="http://localhost", # Change this to be the URL base for your server. 23 # eg. http://localhost:8000 24 # Note that the login application can be placed on 25 # a different server if desirable. 26 resource=SimpleResource(), 27 authenticator=LoginRedirectAuthenticator(secret_key="horses"), 28 anonymous_parameter_name="anonymous", 29 logout_parameter_name="logout" 30 ), 31 "login" : 32 LoginResource( 33 LoginAuthenticator( 34 secret_key="horses", 35 credentials=( 36 ("badger", "abc"), 37 ("vole", "xyz"), 38 ) 39 ) 40 ) 41 }), 42 handle_errors=1 43 ) 44 45 # vim: tabstop=4 expandtab shiftwidth=4