Re: Sending large, generated files

2009-04-15 Thread Graham Dumpleton
On Apr 16, 1:36 am, Rick Wagner wrote: > > From memory, file wrappers at django level, in order to work across > > different hosting mechanisms supported, only allow a file name to be > > supplied. At the WSGI level the file wrapper actually takes a file > > like object. If you were doing this

Re: Sending large, generated files

2009-04-15 Thread Alex Loddengaard
Thanks for the responses, guys. Regarding my deployment, I've been doing my development on my local machine using manage.py. I'll give this a go in WSGI and see what happens. Graham, I totally agree that there are ways to get around my problem outside of trying to send HTTP headers before the me

Re: Sending large, generated files

2009-04-15 Thread Rick Wagner
On Apr 14, 6:55 pm, Graham Dumpleton wrote: > On Apr 15, 7:49 am, Alex Loddengaard wrote: > > > > > I've found several messages on this list discussing ways to send large files > > in a HttpResponse.  One can use FileWrapper, or one can use a generator and > > yield chunks of the large file.  

Re: Sending large, generated files

2009-04-14 Thread Graham Dumpleton
On Apr 15, 7:49 am, Alex Loddengaard wrote: > I've found several messages on this list discussing ways to send large files > in a HttpResponse.  One can use FileWrapper, or one can use a generator and > yield chunks of the large file.  What about the case when the large file is > generated at H

Re: Sending large, generated files

2009-04-14 Thread Ryan Kelly
> Looking at the code for the wsgi handler, it does call start_response() > before processing any of the response body - my understanding is that > this should cause the headers to be sent immediately. Humph, looks like my understanding isn't so hot - PEP 333 explicitly forbids start_response fro

Re: Sending large, generated files

2009-04-14 Thread Ryan Kelly
> I've found several messages on this list discussing ways to send large > files in a HttpResponse. One can use FileWrapper, or one can use a > generator and yield chunks of the large file. What about the case > when the large file is generated at HTTP request time? In this case, > it would be a

Sending large, generated files

2009-04-14 Thread Alex Loddengaard
I've found several messages on this list discussing ways to send large files in a HttpResponse. One can use FileWrapper, or one can use a generator and yield chunks of the large file. What about the case when the large file is generated at HTTP request time? In this case, it would be annoying to