[Twisted-web] new to Guard

twisted-web@twistedmatrix.com twisted-web@twistedmatrix.com
Mon, 15 Dec 2003 19:03:15 +0200


> Hello there my Twisted fellow mates,
> 
> I have used Twisted to build an http web interface.
> i want to add an authentication form before logging into the site
> i'm a bit confused from the cred/guard documentation...
> 
> How do i attach a guard to my existing web server??
> And how do i redirect to the main page after logged in??
> I'll appriciate it if someone can guide me through the initial steps.
> 
> here is an little example of the main class code:
> *************************************************
> import os
> 
> from twisted.web import server, static
> from twisted.application import service, internet
> 
> from main import MainPage
> 
> ##########################
> 
> # Create Web server
> root = MainPage() # inherits from page.Page
> root.putChild("css", static.File("css"))    # css subdir
> site = server.Site(root)
> 
> # Create Application
> application = service.Application("webserver")
> 
> # Create Web service
> port = 8080
> web = internet.TCPServer(port, site)
> web.setServiceParent(application)
> 
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>