django-channels-spectacular

Auto-generate interactive AsyncAPI 3.0 docs for your Django Channels WebSocket consumers.

Tests Documentation status Coverage

django-channels-spectacular is the missing documentation layer for Django Channels — think of it as drf-spectacular for WebSockets. Annotate your consumer’s action handlers once and get a live, browsable AsyncAPI 3.0 spec served straight from your Django app. No separate tooling, no manual YAML, no drift between code and docs.

What you get out of the box:

  • A View serving asyncapi.yaml with a fully valid AsyncAPI 3.0 spec

  • A hosted viewer UI with syntax-highlighted message schemas

  • An interactive try-it-out WebSocket console for testing from the browser

  • Support for @dataclass, Pydantic models, and DRF serializers as message payloads

  • Multi-consumer docs with a spec-switcher dropdown

  • Query-param jwt, cookie jwt and session-cookie authentication schemes

Tip

Prefer to see it running? A complete chat + notifications project lives in the example/ directory — see Example app.

Table of Contents

License

Provided by Ibukun Olaifa. Licensed under the 3-Clause BSD License.

Indices and tables