1.1 --- a/examples/WSGI/SimpleWithLoginHandler.py Thu Sep 27 22:39:38 2007 +0000
1.2 +++ b/examples/WSGI/SimpleWithLoginHandler.py Thu Sep 27 22:40:25 2007 +0000
1.3 @@ -7,19 +7,35 @@
1.4 #sys.path.append("/home/paulb/Software/Python/WebStack")
1.5 #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common")
1.6
1.7 -from WebStack.Adapters.WSGI import deploy
1.8 +from WebStack.Adapters.WSGI import deploy_as_cgi
1.9 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.10 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
1.11 +from WebStack.Resources.ResourceMap import MapResource
1.12 from Simple import SimpleResource
1.13
1.14 -deploy(
1.15 - LoginRedirectResource(
1.16 - login_url="http://localhost/wsgi/login",
1.17 - app_url="http://localhost",
1.18 - resource=SimpleResource(),
1.19 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.20 - anonymous_parameter_name="anonymous",
1.21 - logout_parameter_name="logout"
1.22 - )
1.23 +deploy_as_cgi(
1.24 + MapResource({
1.25 + "simple" :
1.26 + LoginRedirectResource(
1.27 + login_url="http://localhost/wsgi/login",
1.28 + app_url="http://localhost",
1.29 + resource=SimpleResource(),
1.30 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.31 + anonymous_parameter_name="anonymous",
1.32 + logout_parameter_name="logout"
1.33 + ),
1.34 + "login" :
1.35 + LoginResource(
1.36 + LoginAuthenticator(
1.37 + secret_key="horses",
1.38 + credentials=(
1.39 + ("badger", "abc"),
1.40 + ("vole", "xyz"),
1.41 + )
1.42 + )
1.43 + )
1.44 + }),
1.45 + handle_errors=1
1.46 )
1.47
1.48 # vim: tabstop=4 expandtab shiftwidth=4