4 ms·
Whats the most elegant way for cutting edge Django to do websockets? is it still to 'tack' on the channels package [0] ? compared to FastAPI[1] I really don't
by abledon 6y ago
Whats the most elegant way for cutting edge Django to do websockets? is it still to 'tack' on the channels package [0] ?
compared to FastAPI[1] I really don't want to use it, I only miss the ORM since in FastAPI it looks like you have to manually write the code to insert stuff[2].
[0] https://realpython.com/getting-started-with-django-channels/ https://realpython.com/getting-started-with-django-channels/
[1] https://fastapi.tiangolo.com/advanced/websockets/#create-a-websocket https://fastapi.tiangolo.com/advanced/websockets/#create-a-w...
[2] https://fastapi.tiangolo.com/tutorial/sql-databases/#create-data https://fastapi.tiangolo.com/tutorial/sql-databases/#create-...
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- scrollaway 6y agoAs someone who's done over a decade of Django work: Do use FastAPI, especially if you need websockets and such. Django is great for CRUD apps, MVPs and such. And I've used it with success for larger platforms, but it doesn't take long for me to want something closer to the metal whenever I need custom work. FastAPI has filled that need wonderfully well. I also miss the ORM though… SQLAlchemy is a pain.
- tln 6y agoI rolled a microservice in node to handle websockets from our Django app. I can push a notification into an event queue, make an HTTP call to send a notification, and even use postgres notify/listen. FWIW I'd have just used Pusher.io and triggered via django signals but I didn't want clients to be able to query the list of channels, or have to think about costs. This was more of a Friday hack for fun rather than a core product requirement for profit. But I feel like using a separately deployed and scaled service, agnostic of business logic, was the right move.