Describe DebianNotes/TwistedWeb here.

Classes

Dynamic:

   1 class IPLookup(resource.Resource):
   2     isLeaf = True|False # If True, then don't look up children nodes
   3     def render_GET(self, request):
   4         name = request.args['name'][0]  # query args
   5         return BODY_HTML

Static HTML:

   1 MuninStatic = static.File("/var/www/munin/")

Servers

   1 root = IPLookup()
   2 root.putChild("munin", MuninStatic)
   3 
   4 site = server.Site(root)
   5 reactor.listenTCP(2212, site)
   6 reactor.run()

DebianNotes/TwistedWeb (last edited 2010-05-12 14:00:42 by noway)