Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django StreamingHttpResponse - Consume async iterator #239

Open
vshah11 opened this issue Jan 22, 2024 · 2 comments
Open

django StreamingHttpResponse - Consume async iterator #239

vshah11 opened this issue Jan 22, 2024 · 2 comments

Comments

@vshah11
Copy link

vshah11 commented Jan 22, 2024

Python Version

~=3.10.5

Django Version

4.2.7

Package Version

1.12.1

Browser

Chrome, Safari

Description

Warning: StreamingHttpResponse must consume synchronous iterators in order to serve them asynchronously. Use an asynchronous iterator instead.

My application does not explicitly use StreamingHttpResponse or FileResponse in any of its views and I still keep getting this warning every time my application starts. The application is served under ASGI using Uvicorn. Any suggestions how do I get rid of this warning?

I have narrowed down that django-browser-reload is the one that might be potentially causing this warning for me. Any help is appreciated.

@roushikk
Copy link

Hi, I am able to use django-browser-reload under ASGI using Uvicorn without this issue.
Python: 3.12.2
Django: 4.2.11
Package: 1.12.1

I was also getting the same error but that was caused by Whitenoise as it does not support ASGI as of now.
Are you using whitenoise by any chance? If yes, try disabling it and see if it fixes the issue.

@mraesener-aubex
Copy link

FYI in short:

currently there's an "official" or "blessed" fork of Whitenoise because of ASGI until the Whitenoise maintainers find the time again.

WhiteNoise -> ServeStatic

See evansd/whitenoise#359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants