paulb@307 | 1 | #!/usr/bin/env python |
paulb@307 | 2 | |
paulb@307 | 3 | # NOTE: Path manipulation requires manual customisation. |
paulb@307 | 4 | |
paulb@307 | 5 | import sys |
paulb@307 | 6 | sys.path.append("/home/paulb/Software/Python/WebStack") |
paulb@307 | 7 | sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") |
paulb@307 | 8 | |
paulb@307 | 9 | from WebStack.Adapters import WSGI |
paulb@307 | 10 | from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator |
paulb@307 | 11 | from Simple import SimpleResource |
paulb@307 | 12 | from wsgi_cgi import run_with_cgi |
paulb@307 | 13 | |
paulb@307 | 14 | resource = LoginRedirectResource( |
paulb@307 | 15 | login_url="http://localhost/wsgi/login", |
paulb@307 | 16 | app_url="http://localhost", |
paulb@307 | 17 | resource=SimpleResource(), |
paulb@307 | 18 | authenticator=LoginRedirectAuthenticator(secret_key="horses"), |
paulb@307 | 19 | anonymous_parameter_name="anonymous", |
paulb@307 | 20 | logout_parameter_name="logout" |
paulb@307 | 21 | ) |
paulb@307 | 22 | |
paulb@307 | 23 | # Special magic incantation. |
paulb@307 | 24 | |
paulb@307 | 25 | handler = WSGI.WSGIAdapter(resource) |
paulb@307 | 26 | run_with_cgi(handler) |
paulb@307 | 27 | |
paulb@307 | 28 | # vim: tabstop=4 expandtab shiftwidth=4 |