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

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) reactor.run() Help very much appreciated, _stephan -- 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! +++

On Sun, Sep 28, 2003 at 11:09:05AM +0200, ccom@gmx.net wrote:
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.
<snip>
isLeaf = True
That's the line that's causing your grief. If you set isLeaf on any resource, twisted.web won't look at its children. -- ___________ ___________________________________ | Screwtape | http://livejournal.com/~thristian |______ _____ ___ __ _ _ _ | | "Strange, Enya-like New Age music poured from a cactus." -- Jon Katz |
participants (2)
-
ccom@gmx.net
-
screwtape@froup.com