You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried multiple times to make this work but I've ran out of options. So this is more like a cry for help.
Kinda sucks, since the same application this happens on, would benefit from having websockets enabled.
The text was updated successfully, but these errors were encountered:
T-101
changed the title
ASGI zipfly on Django 4.2 first packages to file(s) to memory, then sends to client
ASGI zipfly on Django 4.2 first packages the file(s) to memory, then sends to client
Apr 21, 2023
Without seeing the code, I really couldn't tell you what the problem is.
Having said that, the easy solution is to separate the downloads from the app itself.
The same code works on both WSGI and ASGI, and it produces the zipfile as expected. The only difference is that in ASGI mode it first creates the zipfile in memory and then sends it to client.
Tried fooling around with this today. It seems to boil down to Django's StreamingHttpResponse not accepting synchronous iterators when in ASGI mode. It throws this warning:
/usr/local/lib/python3.11/site-packages/django/http/response.py:534: Warning: StreamingHttpResponse must consume synchronous iterators in order to serve them asynchronously. Use an asynchronous iterator instead.
Spent a few hours trying to splash async/await and @sync_to_async decorators all around the code, but alas; no success yet.
I've tried multiple times to make this work but I've ran out of options. So this is more like a cry for help.
Kinda sucks, since the same application this happens on, would benefit from having websockets enabled.
The text was updated successfully, but these errors were encountered: