WebStack

examples/Twisted/LoginApp.py

150:a2f3a6b21a3d
2004-05-30 paulb [project @ 2004-05-30 15:58:42 by paulb] Removed anonymous user details from the login example.
     1 #!/usr/bin/env python     2      3 from WebStack.Adapters import Twisted     4 from Login import LoginResource, LoginAuthenticator     5 import twisted.web.server     6 import twisted.internet.reactor     7      8 # Special magic incantation.     9     10 resource = LoginResource(    11     LoginAuthenticator(    12         secret_key="horses",    13         credentials=(    14             ("badger", "abc"),    15             ("vole", "xyz"),    16         )    17     )    18 )    19     20 top_level = Twisted.Dispatcher(resource)    21 site = twisted.web.server.Site(top_level)    22 twisted.internet.reactor.listenTCP(8081, site)    23 twisted.internet.reactor.run()    24     25 # vim: tabstop=4 expandtab shiftwidth=4