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
Attached is a TAC file showing how to do this in nevow. You can use either woven or nevow though. If you use woven, just define Pages instead of Renderers, and use site.Site instead of appserver.NevowSite. -Justin On Mon, 15 Dec 2003 19:03:15 +0200, orya@bgumail.bgu.ac.il said:
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
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (2)
-
Justin Johnson
-
orya@bgumail.bgu.ac.il