paulb@139 | 1 | #!/usr/bin/env python |
paulb@139 | 2 | |
paulb@570 | 3 | # Uncomment and adjust the paths below if WebStack is not installed somewhere |
paulb@570 | 4 | # on the PYTHONPATH. |
paulb@139 | 5 | |
paulb@570 | 6 | #import sys |
paulb@570 | 7 | #sys.path.append("/home/paulb/Software/Python/WebStack") |
paulb@570 | 8 | #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") |
paulb@139 | 9 | |
paulb@324 | 10 | from WebStack.Adapters.CGI import deploy |
paulb@154 | 11 | from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator |
paulb@139 | 12 | from Simple import SimpleResource |
paulb@139 | 13 | |
paulb@324 | 14 | deploy( |
paulb@324 | 15 | LoginRedirectResource( |
paulb@407 | 16 | login_url="http://localhost/cgi/login", # Change this to be the exact URL on your server. |
paulb@407 | 17 | # eg. http://localhost:8000/cgi/LoginHandler.py |
paulb@407 | 18 | app_url="http://localhost", # Change this to be the URL base for your server. |
paulb@407 | 19 | # eg. http://localhost:8000 |
paulb@407 | 20 | # Note that the login application can be placed on |
paulb@407 | 21 | # a different server if desirable. |
paulb@324 | 22 | resource=SimpleResource(), |
paulb@324 | 23 | authenticator=LoginRedirectAuthenticator(secret_key="horses"), |
paulb@324 | 24 | anonymous_parameter_name="anonymous", |
paulb@324 | 25 | logout_parameter_name="logout" |
paulb@450 | 26 | ), |
paulb@450 | 27 | handle_errors=1 |
paulb@139 | 28 | ) |
paulb@139 | 29 | |
paulb@139 | 30 | # vim: tabstop=4 expandtab shiftwidth=4 |