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