DRF Spectacular Sidecar

2026.4.1 · active · verified Sat Apr 11

drf-spectacular-sidecar is a Django application that serves self-contained distribution builds of Swagger UI and Redoc. It acts as an optional addition to `drf-spectacular` for environments without CDN access, but can also be used independently. The project is actively maintained, with versions updated monthly (around the 1st) by sourcing distribution files from npm via jsdelivr. The current version is 2026.4.1.

Warnings

Install

Imports

Quickstart

After installation, add `drf_spectacular_sidecar` to your Django project's `INSTALLED_APPS`. If you are using `drf-spectacular`, configure `SPECTACULAR_SETTINGS` to point `SWAGGER_UI_DIST`, `SWAGGER_UI_FAVICON_HREF`, and `REDOC_DIST` to `'SIDECAR'` to utilize the locally served assets.

# settings.py
INSTALLED_APPS = [
    # ... your other apps
    'drf_spectacular_sidecar',
    'drf_spectacular', # Only if you are using drf-spectacular
    # ...
]

# Only if you are using drf-spectacular and want to use the sidecar for UI assets
SPECTACULAR_SETTINGS = {
    'SWAGGER_UI_DIST': 'SIDECAR',
    'SWAGGER_UI_FAVICON_HREF': 'SIDECAR',
    'REDOC_DIST': 'SIDECAR',
    # ... other drf-spectacular settings
}

view raw JSON →