Skip to main content

No project description provided

Project description

Scalar API Reference for Django Ninja

Discord

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.1.tar.gz (3.1 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.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scalar_django_ninja-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 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.1.tar.gz
Algorithm Hash digest
SHA256 4be910d3981e4b1fb0b1adce9cd2113379a1438664f11ec7ca6d5c563504bc3d
MD5 e02df7c2f508ed5392a656220db998ac
BLAKE2b-256 5f59ecff6b2003e2790bcae1f0b512147baf9d0c8a30ef9a5d198dace56ec1cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scalar_django_ninja-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88f91127bf2a2c8eeb4e7c15daef93df45ad6d4f078c555b452f10771571c692
MD5 1645deedf28c63000cacf9a58e833fe8
BLAKE2b-256 6c08de0e6d4cb7b2d685a00bafcea5fe79276ffbdcb268fab36895ed6db2ee73

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