[Twisted-Python] new to Guard
orya at bgumail.bgu.ac.il
orya at bgumail.bgu.ac.il
Mon Dec 15 11:39:10 EST 2003
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)
More information about the Twisted-Python
mailing list