Writing a chat application in Django 4.2 using async StreamingHttpResponse

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • sse-starlette

  • this makes token streaming so much easier in python https://github.com/sysid/sse-starlette

  • realtime

    Broadcast, Presence, and Postgres Changes via WebSockets

  • Where can I learn more about this? I've been thinking of trying to integrate Supabase Realtime (https://github.com/supabase/realtime) into my Django app (without the rest of Supabase), but I'd also like to keep things even simpler if possible.

    Also, what was the reason not to go with Gevent?

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • asgiref

    ASGI specification and utilities

  • Look at the intended semantics [1], and then read the implementation [2]. Can you figure out if the implementation is correct? Can you infer the possible limitations of the approach at glance? Can your async library actually handle being called with multiple event loops installed?

    I have zero trust in this code and I have been bitten by fixes to this library that introduced deadlocks in my own code.

    [1] https://github.com/django/asgiref#synchronous-code--threads.

    [2] https://github.com/django/asgiref/blob/main/asgiref/sync.py#...

  • starlette

    The little ASGI framework that shines. 🌟

  • Same here, but without these weird utils it doesn't get any better.

    I have 7 YoE with Django. Its great at so many things. You see some code, like middlewares, and immediately understand what's going on.

    Now, we also have Starlette. The base of all new, fancy asgi libraries. Here's the base middleware class.

    https://github.com/encode/starlette/blob/8d7a1cacfb3e1a30cbb...

    In the last couple of years I heard 'we're running fastapi on production. Wanna join us?' so many times... but the reality is that it's still not suitable for prod. Who wants to work with a code like that if you have a readable, stable Django? I'm clueless.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts