Skip to main content

No project description provided

Project description

Scalar API Reference for Django Ninja

[!NOTE] Disclaimer 📢

This is a fork of the original scalar docs implementation for django-ninja, if you are looking for the original version, check the link below

official repository

Summary

The easiest way to render a modern and beautiful API reference based on your Django Ninja OpenAPI document.

django-ninja

Installation

pip install git+https://github.com/scalar/scalar.git#subdirectory=integrations/django-ninja

Usage

Integrating Scalar with Django Ninja is simple. Just pass the ScalarViewer instance to the docs parameter of the NinjaAPI instance.

from ninja import NinjaAPI
from scalar_django_ninja import ScalarViewer

api = NinjaAPI(
    version="1.0.0",
    title="API Reference",
    description="API Reference for the Scalar Django Ninja Plugin",
    docs=ScalarViewer(),
    docs_url="/docs/",
)

@api.get("/add")
def add(request, a: int, b: int):
    return {"result": a + b}


urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/", api.urls),
]

This renders a beautiful API reference at /api/docs based on your API.

Community

We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar

License

The source code in this repository is licensed under MIT.

Project details


Download files

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

Source Distribution

scalar_django_ninja-0.1.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

scalar_django_ninja-0.1.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file scalar_django_ninja-0.1.3.tar.gz.

File metadata

  • Download URL: scalar_django_ninja-0.1.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.6.87.1-microsoft-standard-WSL2

File hashes

Hashes for scalar_django_ninja-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cc262b704f440397946a0a172cc4297bfcefc76ea7c8e3ffda6e8cc9f31b2ef6
MD5 143ad08a929ce1da1106cc7710f6c0f5
BLAKE2b-256 0df496704cb01f26c5090371ed443eab7c39bb6ab93b3a21e15df106b9144a59

See more details on using hashes here.

File details

Details for the file scalar_django_ninja-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: scalar_django_ninja-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.6.87.1-microsoft-standard-WSL2

File hashes

Hashes for scalar_django_ninja-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 553d6320aec950342d6f440d4afb14424f0922fbd53c52f5631fea8b23ebc8da
MD5 01fefeee3cacf816b12f72522dd4cd6b
BLAKE2b-256 ebd46d9dad395a0180e70052d5d8f5b31e9d38d7a90459fabda0a6a1d4bd2c5b

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