Add WebSockets, long-poll HTTP and other async protocols to a Django project
open sourceBSD-3-Clausefree
Django Channels is an official Django project that augments Django with WebSocket, long-poll HTTP, task offloading and other asynchronous support, using familiar Django patterns. It wraps Django's native async view support so a project can handle long-running connections in synchronous, fully asynchronous or mixed code, integrates with Django's auth and session systems, and adds channel layers for communication between processes. It is served by Daphne or another ASGI server, with channels_redis as its Redis channel layer backend.
Problems it solves
- add WebSocket support to an existing Django app
- push live updates from a Django backend to the browser
- run long-lived connections like chat in a Django project
Features
- WebSocket and long-poll HTTP handling in Django projects
- consumers written synchronously, asynchronously or both
- integration with Django's auth and session systems
- channel layers for communication between processes
- routing for multiple protocols in one application
Limitations
- Maintained on a best-effort basis: its maintainers can only guarantee time for fixing security holes1
Alternatives
The same job
These do what Django Channels does.
- Centrifugo Scalable realtime messaging and state sync for any stack
- channels_redis Redis channel layer backend for Django Channels
