[Twisted-web] Output filters

Donovan Preston dp at ulaluma.com
Tue Dec 21 12:28:34 MST 2004

On Dec 21, 2004, at 9:32 AM, Larry White wrote:

> Hi,
> I'm interested in using twisted web (based on what i've read - I can't
> get it to install on my machine yet), and had a question about the
> design.
> It seems that the app routes requests to nodes in the resource tree.
> Is it possible to apply processing to the requests before and after
> the resource is retrieved?  In particular, can I specify that I want
> all the nodes on certain branches to have the same pre and post
> processing?  I'm thinking of something along the lines of Java Servlet
> Filters.

It's pretty much possible to do anything you want with twisted.web, 
since it's python and the code is there and fairly short. However, 
there is currently no support for chaining processors like you describe 
here. It wouldn't be too hard to add, but you'd probably have to do 
some monkey patching on request.write to get what you want.

I think foom has plans for piping output through multiple processors 
for web2. I'll let him talk about any relevance if he wants.


More information about the Twisted-web mailing list