# django StreamingHttpResponse - Consume async iterator

**URL:** <https://forum.djangoproject.com/t/django-streaminghttpresponse-consume-async-iterator/27274>\
**Category:** Mystery Errors\
**Created:** [January 22, 2024, 8:23pm UTC](https://forum.djangoproject.com/t/django-streaminghttpresponse-consume-async-iterator/27274 "2024-01-22T20:23:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vshah11](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/vshah11/32/18612_2.png) [@vshah11](https://forum.djangoproject.com/u/vshah11)\
**Post date:** [January 22, 2024, 8:23pm UTC](https://forum.djangoproject.com/t/django-streaminghttpresponse-consume-async-iterator/27274/1 "2024-01-22T20:23:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 22, 2024, 8:36pm UTC](https://forum.djangoproject.com/t/django-streaminghttpresponse-consume-async-iterator/27274/2 "2024-01-22T20:36:37Z")

</div>

See the thread at [StreamingHttpResponse must consume synchronous iterators](https://forum.djangoproject.com/t/streaminghttpresponse-must-consume-synchronous-iterators/20853) for some ideas on how to track this down.

Note that it’s possible that this is being caused by a third-party library and not _your_ code, so you’ll need to check those out too.

---

<div class="post-metadata">

**Author:** ![vshah11](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/vshah11/32/18612_2.png) [@vshah11](https://forum.djangoproject.com/u/vshah11)\
**Post date:** [January 22, 2024, 8:47pm UTC](https://forum.djangoproject.com/t/django-streaminghttpresponse-consume-async-iterator/27274/3 "2024-01-22T20:47:44Z")

</div>

The latest comment on the thread ('Sept 23) still does not have any resolution. I myself tried to look at the thread and its suggestions before raising one of my own.

My code does use django-browser-reload which has a section in its documentation that might give some insights into solving this issue-

[django-browser-reload · PyPI](https://pypi.org/project/django-browser-reload/).

However, I am not able to figure out what I need to do in order to stop it from consuming the synchronous iterator. Any help would be appreciated.

 ![Screenshot 2024-01-07 at 11.17.36 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/3X/6/f/6f8ba62af917097238b61d732c316831127266a0.png)

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 22, 2024, 8:54pm UTC](https://forum.djangoproject.com/t/django-streaminghttpresponse-consume-async-iterator/27274/4 "2024-01-22T20:54:03Z")

</div>

Since that (django-browser-reload) is a third-party library, I suggest you pursue this in that project. Start by looking at the issues (both open and closed) to see if there’s a solution for this.

If not, you may want to open this as an issue in that project.

---

<div class="post-metadata">

**Author:** ![JonasTischer](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jonastischer/32/28075_2.png) [@JonasTischer](https://forum.djangoproject.com/u/JonasTischer)\
**Post date:** [April 13, 2025, 7:26am UTC](https://forum.djangoproject.com/t/django-streaminghttpresponse-consume-async-iterator/27274/5 "2025-04-13T07:26:56Z")

</div>

I can confirm that I have the same error and I don’t use django-browser-reload. I do use django-ninja but I’m not sure whether it is related to that.

`Warning: StreamingHttpResponse must consume asynchronous iterators in order to serve them synchronously. Use a synchronous iterator instead.`

---

<div class="post-metadata">

**Author:** ![toastdriven](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/toastdriven/32/29005_2.png) [@toastdriven](https://forum.djangoproject.com/u/toastdriven)\
**Post date:** [June 23, 2025, 9:18pm UTC](https://forum.djangoproject.com/t/django-streaminghttpresponse-consume-async-iterator/27274/6 "2025-06-23T21:18:51Z")

</div>

I know this post is ancient (mea culpa), but I landed here during an upgrade project from Django 3.X to Django 4.2.

A possible culprit of your error may be the `whitenoise` package. It was raising this warning when running under ASGI. As of `whitenoise==6.9.0` (current), there’s no ASGI support. If you’re using `whitenoise` & hitting this warning, you may want to investigate either:

- [`ServeStatic`](https://github.com/Archmonger/ServeStatic/): A fork of `whitenoise` w/ ASGI & other bugfixes
- [`blacknoise`](https://github.com/matthiask/blacknoise): Inspired by `whitenoise` & directly aimed at ASGI support
