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