Cliff Wells wrote:
Hi,
I've been toying with the notion of having templates have more control
over how they are rendered by allowing them to request fragments from an
application. I did a simple test implementation that simply used
urllib2 to call back into the Pylons application as a completely
separate request, and this works great except that it's obviously
inefficient. Of course, in the apparent tradition of Ian thought of it
first, I stumbled across this:
http://pythonpaste.org/module-paste.recursive.html
which would seem to be exactly what I'm looking for: a way to request
fragments from a WSGI app in an efficient manner.
This brings me to my questions. Can this be used with Pylons? If so,
how? As middleware in config/middleware.py? I'm afraid I'm a bit hazy
on how this works.
Yeah, it can be used in Pylons. It might(?) be instantiated already;
easy enough to tell, I suppose, if the key is there. If not, I think
Pylons should put it in place generally, or something similar. (I'm
actually thinking of putting into place a simpler middleware that just
puts {SCRIPT_NAME: (env_copy, app)} into the environment and lets you
use that however you want -- lately that's what I've been doing anyway
to give myself more control, but just grabbing the application object
out of what paste.recursive puts in the environment.)
--
Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---