1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/examples/Django/simplewithloginapp.py Sat Jan 14 01:53:54 2006 +0000
1.3 @@ -0,0 +1,20 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +from WebStack.Adapters import Django
1.7 +from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
1.8 +from Simple import SimpleResource
1.9 +
1.10 +resource = LoginRedirectResource(
1.11 + login_url="http://localhost/login/app.login",
1.12 + app_url="http://localhost",
1.13 + resource=SimpleResource(),
1.14 + authenticator=LoginRedirectAuthenticator(secret_key="horses"),
1.15 + anonymous_parameter_name="anonymous",
1.16 + logout_parameter_name="logout",
1.17 + use_logout_redirect=0
1.18 +)
1.19 +
1.20 +def loginredirect(request, *args):
1.21 + return Django.respond(request, resource, handle_errors=0)
1.22 +
1.23 +# vim: tabstop=4 expandtab shiftwidth=4