[Twisted-Python] serving dynamic on root and still serve static somehow

ccom at gmx.net ccom at gmx.net
Sun Sep 28 05:09:05 EDT 2003

The general question propably is: How can I  serve my main web app on root
but still be able to serve flat files such as images and style sheets.

Say I want to run a webserver that provides a dynamic page on
"http://domain.com/" and a static file tree on "http://domain.com/static/". With the code I
have currently it always processes the dynamic page and never reaches the
"static" child:

class Dynamic(resource.Resource):
    isLeaf = True    
    return "mock dynamic page"
root = Container()
root.putChild('static', static.File('.'))
site = server.Site(root) 

reactor.listenTCP(8080, site)

Help very much appreciated,


NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++

More information about the Twisted-Python mailing list