Re: Streaming templating languages for use as WSGI body.

2011-01-07 Thread Alice Bevan–McGregor
On 2011-01-07 07:17:33 -0800, Michael Ströder said: As I read section 7.2.2 (Length) the Content-length header is only required in HTTP *requests* if the body contains data. According to the text it's not required in HTTP *responses*. You are correct; I mis-read that section in my haste.

Re: Streaming templating languages for use as WSGI body.

2011-01-07 Thread Michael Ströder
Alice Bevan–McGregor wrote: > On 2011-01-06 11:11:27 -0800, Adam Tauno Williams said: >> On Thu, 2011-01-06 at 11:07 -0800, Alice Bevan–McGregor wrote: >>> On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said: With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a Content-Lengt

Re: Streaming templating languages for use as WSGI body.

2011-01-06 Thread Alice Bevan–McGregor
On 2011-01-06 11:11:27 -0800, Adam Tauno Williams said: On Thu, 2011-01-06 at 11:07 -0800, Alice Bevan–McGregor wrote: On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said: With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a Content-Length header - so you have to generate the enti

Re: Streaming templating languages for use as WSGI body.

2011-01-06 Thread Adam Tauno Williams
On Thu, 2011-01-06 at 11:07 -0800, Alice Bevan–McGregor wrote: > On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said: > > > With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a > > Content-Length header - so you have to generate the entire response at > > once [however you want to

Re: Streaming templating languages for use as WSGI body.

2011-01-06 Thread Alice Bevan–McGregor
On 2011-01-06 10:00:39 -0800, Adam Tauno Williams said: With HTTP/1.0 [and WSGI is HTTP/1.0 only] you have to provide a Content-Length header - so you have to generate the entire response at once [however you want to muddy "at once"]. Both of these statements are false. Streaming responses t

Re: Streaming templating languages for use as WSGI body.

2011-01-06 Thread Adam Tauno Williams
On Wed, 2011-01-05 at 14:56 -0800, Alice Bevan–McGregor wrote: > Howdy! > I'm trying to find a templating engine whose templates can be consumed > directly as a WSGI response body iterable. So far I haven't been very > successful with Google; the engines I've found universally generate a > mono

Re: Streaming templating languages for use as WSGI body.

2011-01-05 Thread Alice Bevan–McGregor
Not sure if it's bad form to respond to your own posts, but here goes. ;) Coding up a quick hack of a templating engine, I've produced this: http://pastie.textmate.org/private/ws5jbeh1xyeaqtrhahevqw (The implementation of the engine itself is a base class that overrides __call__ and __getit

Streaming templating languages for use as WSGI body.

2011-01-05 Thread Alice Bevan–McGregor
Howdy! I'm trying to find a templating engine whose templates can be consumed directly as a WSGI response body iterable. So far I haven't been very successful with Google; the engines I've found universally generate a monolithic rendered string. Bonus points for templating engines that supp