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 scalar-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.4.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.4-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scalar_django_ninja-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 35428bd57bb1871d02493d84f4925f0b125705722b8d5cbe8abae4bedba19293
MD5 77a557bcde77b5c15d7a1635b712a83e
BLAKE2b-256 3b87121471fa087e759f942b9ff7b0f254b20b03a8d5c8f3056340e67b90cd58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scalar_django_ninja-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 03082c9661446377f93fef4abd2677a710144b5597b9045fe3be3205aa326f48
MD5 b8fddede829beefac7d1f0aea20a2c84
BLAKE2b-256 135db49a36c3bfb15bec3caf231e58c170eceb2e9268fbef844cdb649988a026

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