channels
Brings async, event-driven capabilities to Django.
What it is and what it does
Channels extends Django beyond its traditional request-response model to support real-time, bidirectional communication protocols like WebSocket and long-polling HTTP. It does this by layering ASGI (Asynchronous Server Gateway Interface) support on top of Django, letting you write async consumers that handle persistent connections using familiar Django patterns—routing, middleware, authentication—rather than forcing you into a separate framework.
The package itself provides the core consumer classes and routing layer; it depends on Django and asgiref for the underlying async infrastructure. For production use, you'll need to pair it with an ASGI application server like Daphne (a separate package from the same Django project) and optionally channels_redis for multi-process channel layers. It's actively maintained by the Django core team, supports Python 3.9+ and Django 4.2 through 6.0, and has no known security vulnerabilities.
Use it for:
- Build real-time chat or messaging applications where messages appear instantly without page refresh.
- Implement live notifications or activity feeds that push updates to connected clients.
- Create collaborative editing or whiteboarding tools that sync changes across multiple users.
- Offload long-running tasks to background workers while keeping the client connection alive.
- Stream live data (sensor readings, stock prices, sports scores) to multiple subscribers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Channels augments Django with WebSocket, long-poll HTTP, task offloading, and async support using familiar Django patterns and a flexible ASGI-based framework.
Yes. Channels is an official Django project with active maintenance, low install friction, no known vulnerabilities, and a permissive license. Install it if you need WebSocket or real-time async support in Django; pair it with Daphne and optionally channels_redis for production. Skip it if your application has no real-time requirements.
Install
channels on PyPI
pip
pip install channelsuv
uv add channelspoetry
poetry add channelsInstalling channels
Before you install
Low install friction; pure Python wheel. Actively maintained by Django core team with recent commits and clear security reporting process. Supports current Python versions (3.9+) and recent Django releases (4.2 through 6.0).
License in practice
BSD license is permissive; you can use, modify, and distribute this package with minimal restrictions in commercial and open-source projects.
Quickstart
pip install channels
import channels
from channels.generic.websocket import AsyncWebsocketConsumer
class MyConsumer(AsyncWebsocketConsumer):
async def connect(self):
await self.accept()
Requires Django 4.2+ and an ASGI application server (e.g. Daphne) to run; development server alone is insufficient for WebSocket support.
Verify before relying
- Whether Daphne or another ASGI server is bundled or must be installed separately for production use.
- Performance characteristics and scaling limits for concurrent WebSocket connections.
- Specific Redis backend requirements if using channels_redis for multi-process deployments.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — Django, asgiref |
| Maintenance | actively maintained — 267 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,288,306/month — #1,939 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: channels-4.3.2-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
channels-redisProvides Redis-backed channel layers for Django…
permissive · top 5,000 on PyPI
daphneDaphne is an ASGI server that handles HTTP,…
permissive · top 5,000 on PyPI
django-eventstreamAdds Server-Sent Events (SSE) streaming to…
permissive · top 15,000 on PyPI
asgirefProvides ASGI base libraries including…
permissive · top 1,000 on PyPI
types-channelsProvides type stubs for the channels package,…
permissive · top 15,000 on PyPI
uvicornUvicorn is an ASGI web server that runs async…
permissive · top 100 on PyPI
starletteStarlette is a lightweight ASGI framework for…
permissive · top 100 on PyPI
httpx-wsAdds WebSocket support to HTTPX, enabling sync…
permissive · top 5,000 on PyPI
django-gripIntegrates Django with GRIP-compatible proxies…
permissive · top 15,000 on PyPI
django-dramatiqIntegrates Dramatiq, a distributed task queue,…
unclear · top 15,000 on PyPI