[Twisted-Python] static.Data and embedded URL's...

Stuart Hungerford stuart.hungerford at anu.edu.au
Sun Aug 10 22:06:37 MDT 2003


Hi all,

I'm using twisted.web for an application that generates very
simple HTML page responses.  It's probably way too simple to
consider using Woven.

I've have some resources inheriting from twisted.web.static.Data
and in their render() method they use a very simplistic
template/substitute:

       def render(self, request):
           lines = load_template('foo.html')
           lines = lines % ('foo', 'bar')
           return lines

My question is how embedded URL's in the string result are handled.
Should static.Data pass URL's originally from foo.html for local
images and stylesheets etc for processing?   I may have misunderstood
the role of the static.* classes here?

I'd welcome any comments on a more twistedonic way of doing this
kind of thing...
Cheers,

Stu

--
:: Stuart Hungerford (stuart.hungerford at anu.edu.au)
:: ANU Internet Futures Group





More information about the Twisted-Python mailing list