Django 5.0: Elevating Experiences with Server-Sent Events – A Journey from Polling to Real-Time Vibe
summary
Shows how Django 5.0 uses Server-Sent Events + async streaming HTTP responses to replace polling without rewriting the sync app, handling disconnections and cleanup now supported in 5.0; uses plain JavaScript EventSource and htmx on the client, a separate async service that listens to a common channel implemented with Redis Streams, and a Mastodon firehose demo. Local dev works with Daphne; rough load test on a tiny Render instance yields ~500 polling connections vs ~150–200 SSE+Redis streams.
AI-written summary · about
chapters (11)
- 0:00Introduction and concepts
- 1:48Event stream format
- 4:10Implementing SSE in Django
- 6:48Local development setup
- 8:24Real-time use cases
- 11:02Architecture for real-time
- 13:52Integrating Redis streams
- 16:16Backend stream listening
- 17:42Frontend implementation
- 18:47SSE versus websockets
- 21:15Performance and Q&A
related talks
26mUsing Django 4.2's StreamingHttpResponse and HTMX SSE to provide real time notifications
22mDjango Channels Teaching a mature framework new tricks
31mReinventing Django for the Real-Time Web
27mTaking Django Async
45mWebSockets: Intro to Messaging
38mButter smooth, interactive applications with Django...
26mThe end of polling
34mRealtime websites with Django and Meteor
