This is a repository prepared for answer on StackOverflow to have ability to download code and test it.
Question is about Django StreamingHttpResponse in async Django views. Look here for more details.
daphne -b 0.0.0.0 -p 8000 webapp.webapp.asgi:application
NOTE: I have 2 levels folder, but this is just because copy-paste from my test project. In yours it still can be
sse_demo.asgi:application
python test_stream.py
Uncomment line in test_stream.py
:
r = requests.get('http://localhost:8000/sse', stream=True)
Uncomment line in test_stream.py
:
r = requests.get('http://localhost:8000/sse_async', stream=True)