1.1 --- a/examples/Webware/SimpleWithLoginContext/__init__.py Sat May 24 15:21:53 2008 +0000
1.2 +++ b/examples/Webware/SimpleWithLoginContext/__init__.py Sun Aug 24 20:51:10 2008 +0200
1.3 @@ -1,39 +1,30 @@
1.4 #!/usr/bin/env python
1.5
1.6 """
1.7 -Webware context for the Simple application (post Webware 0.8.1).
1.8 +Webware context for the SimpleWithLogin application (post Webware 0.8.1).
1.9 """
1.10
1.11 from WebStack.Adapters.Webware import deploy
1.12 -from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.13 -from WebStack.Resources.Login import LoginResource, LoginAuthenticator
1.14 -from WebStack.Resources.ResourceMap import MapResource
1.15 -from Simple import SimpleResource
1.16 +from SimpleWithLogin import get_site_map
1.17 +
1.18 +# Change this to be the exact URL.
1.19 +# eg. http://localhost:8000/myapp/login
1.20 +
1.21 +login_url = "http://localhost:9080/simplewithlogin/login"
1.22 +
1.23 +# Change this to be the URL base for your server.
1.24 +# eg. http://localhost:8000
1.25 +
1.26 +app_url = "http://localhost:9080" # No trailing "/"!
1.27 +
1.28 +# Must match the key used elsewhere.
1.29 +
1.30 +secret_key = "horses"
1.31 +
1.32 +resource = get_site_map(app_url, login_url, secret_key)
1.33
1.34 # NOTE: Initialising a shared resource.
1.35
1.36 -resource = MapResource({
1.37 - "simple" :
1.38 - LoginRedirectResource(
1.39 - login_url="http://localhost:9080/simplewithlogin/login",
1.40 - app_url="http://localhost:9080",
1.41 - resource=SimpleResource(),
1.42 - authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.43 - anonymous_parameter_name="anonymous",
1.44 - logout_parameter_name="logout"
1.45 - ),
1.46 - "login" :
1.47 - LoginResource(
1.48 - LoginAuthenticator(
1.49 - secret_key="horses",
1.50 - credentials=(
1.51 - ("badger", "abc"),
1.52 - ("vole", "xyz"),
1.53 - )
1.54 - )
1.55 - )
1.56 - })
1.57 -
1.58 urlParser = deploy(resource, handle_errors=0)
1.59
1.60 # vim: tabstop=4 expandtab shiftwidth=4