1.1 --- a/examples/ModPython/SimpleWithLoginApp/SimpleWithLoginHandler.py Sat May 24 15:21:53 2008 +0000
1.2 +++ b/examples/ModPython/SimpleWithLoginApp/SimpleWithLoginHandler.py Sun Aug 24 20:51:10 2008 +0200
1.3 @@ -6,21 +6,26 @@
1.4 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common")))
1.5
1.6 from WebStack.Adapters.ModPython import deploy
1.7 -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.8 -from Simple import SimpleResource
1.9 +from SimpleWithLogin import get_site_map
1.10 +
1.11 +# Change this to be the exact URL.
1.12 +# eg. http://localhost:8000/myapp/login
1.13 +
1.14 +login_url = "http://localhost/login/app"
1.15 +
1.16 +# Change this to be the URL base for your server.
1.17 +# eg. http://localhost:8000
1.18 +
1.19 +app_url = "http://localhost" # No trailing "/"!
1.20 +
1.21 +# Must match the key used elsewhere.
1.22 +
1.23 +secret_key = "horses"
1.24 +
1.25 +resource = get_site_map(app_url, login_url, secret_key)
1.26
1.27 # NOTE: Not sure if the resource should be maintained in a resource pool.
1.28
1.29 -resource = LoginRedirectResource(
1.30 - login_url="http://localhost/login/app",
1.31 - app_url="http://localhost",
1.32 - resource=SimpleResource(),
1.33 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.34 - anonymous_parameter_name="anonymous",
1.35 - logout_parameter_name="logout",
1.36 - use_logout_redirect=0
1.37 -)
1.38 -
1.39 handler, _no_authentication = deploy(resource, handle_errors=0)
1.40
1.41 # vim: tabstop=4 expandtab shiftwidth=4