1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/examples/BaseHTTPRequestHandler/LoginApp.py Thu May 27 22:16:53 2004 +0000
1.3 @@ -0,0 +1,16 @@
1.4 +#!/usr/bin/env python
1.5 +
1.6 +from WebStack.Adapters import BaseHTTPRequestHandler
1.7 +from Login import LoginResource, LoginAuthenticator
1.8 +import BaseHTTPServer
1.9 +
1.10 +# Special magic incantation.
1.11 +
1.12 +handler = BaseHTTPRequestHandler.HandlerFactory(
1.13 + LoginResource(LoginAuthenticator("horses"))
1.14 +)
1.15 +address = ("", 8081)
1.16 +server = BaseHTTPServer.HTTPServer(address, handler)
1.17 +server.serve_forever()
1.18 +
1.19 +# vim: tabstop=4 expandtab shiftwidth=4
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/examples/BaseHTTPRequestHandler/SimpleWithLogin.py Thu May 27 22:16:53 2004 +0000
2.3 @@ -0,0 +1,22 @@
2.4 +#!/usr/bin/env python
2.5 +
2.6 +from WebStack.Adapters import BaseHTTPRequestHandler
2.7 +from Simple import SimpleResource
2.8 +from LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator
2.9 +import BaseHTTPServer
2.10 +
2.11 +# Special magic incantation.
2.12 +
2.13 +handler = BaseHTTPRequestHandler.HandlerFactory(
2.14 + LoginRedirectResource(
2.15 + "http://localhost:8081",
2.16 + "http://localhost:8080",
2.17 + SimpleResource(),
2.18 + LoginRedirectAuthenticator("horses")
2.19 + )
2.20 +)
2.21 +address = ("", 8080)
2.22 +server = BaseHTTPServer.HTTPServer(address, handler)
2.23 +server.serve_forever()
2.24 +
2.25 +# vim: tabstop=4 expandtab shiftwidth=4