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

Yeah, I noticed that when I set isLeaf = False in my root node my child nodes will get processed. At the same time my root will then serve a 404-No Such Resource, though. Serving static files on root and dynamic ones as child nodes was easy but how do I do it the other way round--dynamic on root and static files on a child node?
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.
_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 Mon, Sep 29, 2003 at 07:24:15PM +0200, ccom@gmx.net wrote:
Yeah, I noticed that when I set isLeaf = False in my root node my child nodes will get processed. At the same time my root will then serve a 404-No Such Resource, though.
With isLeaf=False, the root resource will _never_ have its render() method called. That is because the request for the root resource is always '/', not ''. (i.e., "GET / HTTP/1.1", not "GET HTTP/1.1") '/'.split('/') == [''], which means that getChild('', request) will be called. Therefore, your root resource must respond to getChild('', request). -- Twisted | Christopher Armstrong: International Man of Twistery Radix | Release Manager, Twisted Project ---------+ http://twistedmatrix.com/users/radix.twistd/
participants (2)
-
ccom@gmx.net
-
Christopher Armstrong