[Twisted-web] Set request headers in rend.Page

Mary Gardiner mary-twisted at puzzling.org
Mon May 31 19:58:31 MDT 2004

On Mon, May 31, 2004, Donovan Preston wrote:
> That's probably an oversight; beforeRender and afterRender should 
> support deferreds.

Filed Issue 49 about this:

> Do this:
> def renderHTTP(self, request):
>     d = doSomethingDeferred()
>     return d.addCallback(self.myCallback, request)
> def myCallback(self, result, request):
> 	# Do whatever
> 	return rend.Page.renderHTTP(self, request)
> rend.Page.renderHTTP returns a deferred which fires when the page is 
> done rendering.

OK, a simple test case (like that attached to Issue 49) shows that this
does work, but I'm having trouble with it as part of my codebase. I will
hunt for the problem elsewhere for now.


More information about the Twisted-web mailing list