[Twisted-Python] twisted.web questions
abierbaum at gmail.com
Mon Jun 14 11:28:18 EDT 2010
On Mon, Jun 14, 2010 at 8:38 AM, Itamar Turner-Trauring <itamar at itamarst.org
> On Mon, 2010-06-14 at 08:22 -0500, Allen Bierbaum wrote:
> > 1) Is there any method to stream a large request (ex: PUT or POST with
> > file upload) into the system or does the entire body have to be loaded
> > into memory as part of the request?
> Very large requests get written to disk, rather than memory. This is
> still not ideal, streaming is obviously better - someone may be able to
> suggest how to do it until Twisted gets fixed.
That is unfortunate. Do you know of an example that shows to get access to
that file or does it just show up as a file object in the request?
> > 2) Has anyone used an existing URL Routing system (ex: Routes ,
> > Selector ) and adapted it for use with Twisted? (I know I could
> > use the twisted preferred method of parent child hierarchies, but our
> > application has a better fit with the route-based method used by
> > Pylons, Django, Rails, etc)
> Set isLeaf=True on the Resource, and then render() will get called for
> all sub-paths, and at that point you can dispatch using one of those
I will have to try that. I think it may have problems due to those systems
relying upon the WSGI interface and thus the environ dictionary. I am
guessing I will have to hack them up a bit to make it work.
> > 3) Is there a document anywhere that describes all the environment
> > variables the user can get from the request and how to get to them?
> > (something like the environ section of the WSGI PEP )
> Request objects do not provide any environment variables (that's an
> operating system concept). They provide information about the HTTP
> request. This includes the method, path, and HTTP headers sent by the
I mispoke. I didn't mean the OS environment variables, I meant the
equivalent of the WSGI environ dictionary (the CGI environment). The link
below looks like a great starting point to find them.
> The list of instance variable on Request objects may be what you
> > 4) Are their any wrappers people have developed to make it a bit
> > easier to use deferreds (in particular inlinecallbacks) in the
> > handlers for twisted.web? (I am considering just writing a wrapper
> > myself that provides an interface similar to google app engine webapp
> >  but wanted to check first so I don't reinvent something)
> There's a branch of Twisted that implements this, hopefully it will
> eventually be merged:
Is there anything that is currently holding this up? (ie. is the design on
this branch what will end up in the system or could it change dramatically?)
Thanks for all the answers.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python