1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/examples/WSGI/SimpleWithLoginApp.py Thu Sep 27 22:40:25 2007 +0000
1.3 @@ -0,0 +1,41 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +# Uncomment and adjust the paths below if WebStack is not installed somewhere
1.7 +# on the PYTHONPATH.
1.8 +
1.9 +#import sys
1.10 +#sys.path.append("/home/paulb/Software/Python/WebStack")
1.11 +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common")
1.12 +
1.13 +from WebStack.Adapters.WSGI import deploy
1.14 +from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.15 +from WebStack.Resources.Login import LoginResource, LoginAuthenticator
1.16 +from WebStack.Resources.ResourceMap import MapResource
1.17 +from Simple import SimpleResource
1.18 +
1.19 +deploy(
1.20 + MapResource({
1.21 + "simple" :
1.22 + LoginRedirectResource(
1.23 + login_url="http://localhost:8080/login",
1.24 + app_url="http://localhost:8080",
1.25 + resource=SimpleResource(),
1.26 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.27 + anonymous_parameter_name="anonymous",
1.28 + logout_parameter_name="logout"
1.29 + ),
1.30 + "login" :
1.31 + LoginResource(
1.32 + LoginAuthenticator(
1.33 + secret_key="horses",
1.34 + credentials=(
1.35 + ("badger", "abc"),
1.36 + ("vole", "xyz"),
1.37 + )
1.38 + )
1.39 + )
1.40 + }),
1.41 + handle_errors=1
1.42 +)
1.43 +
1.44 +# vim: tabstop=4 expandtab shiftwidth=4