This commit is contained in:
Víðir Valberg Guðmundsson 2023-05-17 17:06:01 +02:00
parent b23ce26055
commit bb5d8c9019

View file

@ -356,7 +356,7 @@ For this we'll have to update our `stream_messages` function as follows:
:::python :::python
async def stream_messages() -> AsyncGenerator[str, None]: async def stream_messages() -> AsyncGenerator[str, None]:
connection_params = connection.get_connection_params() connection_params = connection.get_connection_params()
# Remove the cursor_factory parameter since I can't get # Remove the cursor_factory parameter since I can't get
# the default from Django 4.2.1 to work. # the default from Django 4.2.1 to work.
@ -435,9 +435,9 @@ Check out the repo for the full code where I've also added a simple form for sub
### Conclusion ### Conclusion
Django might not be the shiniest framework out there, but it is solid and boring - which is a good thing! Django is boring, which is a good thing, to the degree where it is always the safe option. But with the advances in
async support it is becoming a viable, and shiny, option for doing real time stuff. Mix in some other solid and boring
And with the continued work on async support, it is becoming a viable option for doing real time stuff, especially when paired with other solid and boring tech like PostgreSQL and SSE! tech like PostgreSQL and SSE, and you end up with a very solid foundation for building real time applications.
[0]: https://docs.djangoproject.com/en/4.2/releases/4.2/#requests-and-responses [0]: https://docs.djangoproject.com/en/4.2/releases/4.2/#requests-and-responses
[1]: https://docs.djangoproject.com/en/4.2/ref/request-response/#django.http.StreamingHttpResponse [1]: https://docs.djangoproject.com/en/4.2/ref/request-response/#django.http.StreamingHttpResponse