1.1 --- a/examples/BaseHTTPRequestHandler/SimpleWithLoginApp.py Fri Aug 26 18:12:13 2005 +0000
1.2 +++ b/examples/BaseHTTPRequestHandler/SimpleWithLoginApp.py Tue Sep 06 17:35:33 2005 +0000
1.3 @@ -2,18 +2,33 @@
1.4
1.5 from WebStack.Adapters.BaseHTTPRequestHandler import deploy
1.6 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.7 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
1.8 +from WebStack.Resources.ResourceMap import MapResource
1.9 from Simple import SimpleResource
1.10
1.11 print "Serving..."
1.12 deploy(
1.13 - LoginRedirectResource(
1.14 - login_url="http://localhost:8081",
1.15 - app_url="http://localhost:8080",
1.16 - resource=SimpleResource(),
1.17 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.18 - anonymous_parameter_name="anonymous",
1.19 - logout_parameter_name="logout"
1.20 - ),
1.21 + MapResource({
1.22 + "simple" :
1.23 + LoginRedirectResource(
1.24 + login_url="http://localhost:8080/login",
1.25 + app_url="http://localhost:8080",
1.26 + resource=SimpleResource(),
1.27 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.28 + anonymous_parameter_name="anonymous",
1.29 + logout_parameter_name="logout"
1.30 + ),
1.31 + "login" :
1.32 + LoginResource(
1.33 + LoginAuthenticator(
1.34 + secret_key="horses",
1.35 + credentials=(
1.36 + ("badger", "abc"),
1.37 + ("vole", "xyz"),
1.38 + )
1.39 + )
1.40 + )
1.41 + }),
1.42 handle_errors=1
1.43 )
1.44