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