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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_asyncdocs-0.1.1.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_asyncdocs-0.1.1-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file django_asyncdocs-0.1.1.tar.gz.

File metadata

  • Download URL: django_asyncdocs-0.1.1.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for django_asyncdocs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2b2c8cfece5b80c15035f67fbb41877530de2685e07114dc056cd9c77c141874
MD5 cb30e0d904bbbef8ebede743bedd36cf
BLAKE2b-256 b49eea076f913f1b8ab474a54fdc5f8cd3d78d202abdb7f8336af52a115c3b84

See more details on using hashes here.

File details

Details for the file django_asyncdocs-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_asyncdocs-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd1d45b0a10cf621219a22356f1c6ca5c7d9e41abe18bc36d394db08cfc60516
MD5 a232033b29b091b56fa7506c37ef950d
BLAKE2b-256 177209f9d7fcd74a871d55da3481e7feca5d0580df9cc07eb4854d28c0022c2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page