Friday, November 15, 2013

Re: Streaming images with HttpResponse?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJShmKGAAoJEJ9WpvTpw+EqkGgP/iM7cTuNiroeu1/Tu1nddGYG
FS3zgIsYXwMXOV+Mzgw0iVINAY9eU43Nr2KcYUSFXHCBsQJRLMt+tpRcNIOUj2Ws
OaET+vim8TXhJOXyglreT/G39Rm9BWHejrrGxnkX+THhYZA5QfySPI5zpmYvWgHj
ozsk92Viv1+/u5atTyZA6IujjW8oiepri/knqw2l7ymxBztqUX5R399cAU01kdEF
mTTLvTCVw+bYz4qurrgW91/Jj779qaTyJY+k5QxlMS+a+wEfD7EJvbnTRbT7qeXr
6uvoSZrDOT190JUOHzzsrF3u3UxAKWnhmEUxudqWyGo7DlWtJs2mNEIPgleFuHVJ
3bmn6NzZjEia9nubhJdcWDY21hBKYGjEWuC+K5Q/XFkMk1E7pZpX9c5aIX4UJNSy
Huee+s6CI9pot9Xs1DTA06eX9nAx2lRcLauJIFnv3v1smpyFNikh5KW7Z/y+3B+O
CK7GlA5qhM3m09xxl00jls0rud7EUnv52RkT8l4Fkv0BaSzhZVHgRtpjiy2gHpyx
DCdyqJuoDbyF+FvmrGjhMl+zsaNHXBdj5Px7TG8kZFf+Q2Wk9feRPbv649180CWG
a/HAbrzc7uNbQbYN5pKf4/jY/kBxtDBxdHuK0M/B8T53PfrNxipiAdSduiKp5aMM
dX2zWVrkdV6GgbFQIO0X
=8qRK
-----END PGP SIGNATURE-----
Hi there,
I don't know if it's relevant, I've never used it, but the name sounds promising:

StreamingHttpResponse
https://docs.djangoproject.com/en/dev/ref/request-response/#streaminghttpresponse-objects

Cheers,
Tom

Dne Fri, 15 Nov 2013 12:53:23 -0500
Javier Guerra Giraldez <javier@guerrag.com> napsal(a):

> On Fri, Nov 15, 2013 at 12:08 PM, Jorge Cardoso Leitão
> <jorgecarleitao@gmail.com> wrote:
> > I believe that is not possible with Django views. Views are made for
> > request-response, i.e. the client sends a request, the view returns a
> > response, and that's it, end of connection.
>
>
> i think the WSGI standard does support it, by setting a generator
> instead of a string value as the response content.
>
> the generator is a function that yield()s more content each time, so
> the HTTP response becomes a stream of data.
>
> but i think you're right that Django doesn't support it.
>

No comments:

Post a Comment