Skip to main content

django-asyncdocs

"Swagger for everything Swagger doesn't cover."

pypi license asyncapi django

Full docs, screenshots, and the source live on GitHub — this page is a plain-markdown version of the same README, since PyPI's renderer doesn't support the layout GitHub does.


Auto-generated, interactive documentation — and a live test console — for AsyncAPI specs: WebSocket, SSE, MQTT, or any other async protocol your Django project describes with one. Install it, point it at a spec file, and get a browsable page with a sidebar of channels, a payload schema reference, and a "Try it out" console that authorizes, connects, and lets you trigger a real server-side effect to watch a frame arrive — all without leaving the page.

Supports both AsyncAPI dialects (2.x and 3.0) through one normalizer, so a spec written either way renders through the exact same templates.

Screenshots

Index — one card per registered spec:

Index page

Detail — docs + a live test console:

Console page

See it in action (animated): browsing the index and authorizing + connecting.

Features

  • Auto-generated docs — point it at an AsyncAPI YAML file, get a full docs page. Nothing to write by hand, nothing to keep in sync manually.
  • Both AsyncAPI dialects — 2.x and 3.0 render through the exact same templates via one normalizer, so a spec written either way just works.
  • A real test console — authorize, connect, and trigger a server-side action to watch a live frame arrive, without leaving the page.
  • Secure by default — every access denial is a 404, never a 403 or login redirect, so an unauthorized visitor can't even confirm a spec exists.
  • Multi-tenancy hooks — two extension points (TenantResolver, TenantSpecFilter) for projects that already have real tenant isolation to plug in.

Install

1. Install the package

pip install django-asyncdocs

2. Register it and point it at a spec

# settings.py
INSTALLED_APPS = [..., "asyncdocs"]

ASYNC_DOCS = {
    "SPECS": {
        "my-channel": {
            "path": BASE_DIR / "apps" / "ws" / "asyncapi.yaml",
            "login_url": "/api/v1/auth/login/",
            "actions": {"send_test": "myproject.docs_actions.send_test"},
        },
    },
}

3. Mount the URLs

# urls.py
from django.urls import include, path

urlpatterns = [..., path("asyncdocs/", include("asyncdocs.urls"))]

Never written an AsyncAPI spec before, or don't have one yet? Start at writing-your-first-spec.md — it builds one from nothing.

Already have a spec? getting-started.md covers the rest (staff login, the ENABLED gate, verifying it without a browser).

Documentation

How it works

AsyncAPI 2.x vs 3.0, briefly. One normalizer per dialect produces the exact same flat shape regardless of which one a spec is written in — the dialect is recorded once (asyncapi_version) and shown as a badge; nothing downstream branches on it.

Security, briefly. Every access denial (failed staff check, IP allowlist, unknown or tenant-filtered slug) is a 404, never a 403 or a login redirect — so a response never confirms a spec exists to someone who can't see it. The console's token lives in a JS variable for the tab only, never localStorage/sessionStorage/a URL, always masked on screen.

Multi-tenancy, briefly. Ships no working isolation — every staff user sees every spec by default, correct for a single-tenant project. Two hooks (TenantResolver, TenantSpecFilter) let a project that already has real tenant isolation plug it in later as a settings change.

Full details for all three: see the docs.

License

MIT — see LICENSE.

Metadata

Release files for django-asyncdocs 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-asyncdocs 0.1.1
File Size Uploaded
django_asyncdocs-0.1.1.tar.gz 33.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-asyncdocs 0.1.1
File Interpreter ABI Platform
django_asyncdocs-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 68.3 kB

Release files / django_asyncdocs-0.1.1.tar.gz

Download URL django_asyncdocs-0.1.1.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2b2c8cfece5b80c15035f67fbb41877530de2685e07114dc056cd9c77c141874
BLAKE2b-256 checksum
How to use checksums
b49eea076f913f1b8ab474a54fdc5f8cd3d78d202abdb7f8336af52a115c3b84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / django_asyncdocs-0.1.1-py3-none-any.whl

Download URL django_asyncdocs-0.1.1-py3-none-any.whl
Size 34.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd1d45b0a10cf621219a22356f1c6ca5c7d9e41abe18bc36d394db08cfc60516
BLAKE2b-256 checksum
How to use checksums
177209f9d7fcd74a871d55da3481e7feca5d0580df9cc07eb4854d28c0022c2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page