Re: Streaming large responses

2006-01-24 Thread mario ruggier
On Jan 24, 2006, at 3:57 PM, Adrian Holovaty wrote: On 1/24/06, hugo <[EMAIL PROTECTED]> wrote: Currently Django doesn't use this feature - but I think it might be cool if one would be able to pass a generator to HTTPResponse instead of a string and if Django would make use of the WSGI generato

Re: Streaming large responses

2006-01-24 Thread Jeremy Dunck
On 1/24/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > I agree that this would be a fine feature to add. Anybody willing to > work on a patch? I don't think I can do a patch, but I hoped to inform one. I was just reading the bits of WSGI 1.0 to understand what it says on the topic, and this no

Re: Streaming large responses

2006-01-24 Thread Maniac
hugo wrote: It's not required to use chunked transfer, but to know the full size before sending the content, you will have to generate the full content. Sure, if it is some big static thing, you can just ask the filesystem, but if the large stuff is created dynamically, you can't "just set Cont

Re: Streaming large responses

2006-01-24 Thread Adrian Holovaty
On 1/24/06, hugo <[EMAIL PROTECTED]> wrote: > Currently Django doesn't use this feature - but I think it might be > cool if one would be able to pass a generator to HTTPResponse instead > of a string and if Django would make use of the WSGI generator feature > to send out chunked parts. But to do

Re: Streaming large responses

2006-01-24 Thread hugo
>As far as I know such output doesn't have to be chunked. All you need is >to set Content-length and then just feed your your data in small parts >to stdout flushing it every time. That's at least how works my web-mail >system in C++ when outputting attachments. It's not required to use chunked t

Re: Streaming large responses

2006-01-24 Thread Maniac
hugo wrote: But to do this there would have to be support for chunked transfers in the mod_python handler, too, so it wouldn't be a simple patch, but a bit more involved. As far as I know such output doesn't have to be chunked. All you need is to set Content-length and then just feed your y

Re: Streaming large responses

2006-01-24 Thread hugo
>I need to be able to serve potentially large log files with Django. (I >can't serve them as static files.) Rather than loading them into memory >and giving their contents to an HttpResponse object as a string, is it >possible to stream them back to the browser? I'm imagining something like >th

Streaming large responses

2006-01-24 Thread Richie Hindle
Hi, I need to be able to serve potentially large log files with Django. (I can't serve them as static files.) Rather than loading them into memory and giving their contents to an HttpResponse object as a string, is it possible to stream them back to the browser? I'm imagining something like th