1 #!/usr/bin/env python 2 3 from WebStack.Adapters.BaseHTTPRequestHandler import deploy 4 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator 5 from WebStack.Resources.Login import LoginResource, LoginAuthenticator 6 from WebStack.Resources.ResourceMap import MapResource 7 from Simple import SimpleResource 8 9 print "Serving..." 10 deploy( 11 MapResource({ 12 "simple" : 13 LoginRedirectResource( 14 login_url="http://localhost:8080/login", 15 app_url="http://localhost:8080", 16 resource=SimpleResource(), 17 authenticator=LoginRedirectAuthenticator(secret_key="horses"), 18 anonymous_parameter_name="anonymous", 19 logout_parameter_name="logout" 20 ), 21 "login" : 22 LoginResource( 23 LoginAuthenticator( 24 secret_key="horses", 25 credentials=( 26 ("badger", "abc"), 27 ("vole", "xyz"), 28 ) 29 ) 30 ) 31 }), 32 handle_errors=1 33 ) 34 35 # vim: tabstop=4 expandtab shiftwidth=4