[Twisted-Python] using defers with requests

Christopher Armstrong radix at twistedmatrix.com
Sat Nov 15 22:08:14 EST 2003

On Sat, Nov 15, 2003 at 06:57:38PM -0800, charles brandt wrote:
> I am trying to select some data from a database in hopes of eventually using
> it to populate a dynamic page.  Before I dive into woven, I was trying to
> get the following to print selected data directly to a html resource using
> the following code snippet (or various versions of it).   I've only been
> able to get an empty page though ( <html><body></body></html> ).  I'm
> wondering if maybe the request is getting returned before the callback makes
> it to the defer?  Any ideas? Thanks in advance,

Are you sure your code is even being triggered? Since your code isn't
writing out those HTML tags anywhere, it seems like some completely
different resource is being renderred instead of yours. Can you put
some debug prints in "render" and "printResult"?

 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+           http://radix.twistedmatrix.com/

More information about the Twisted-Python mailing list