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

Uploaded Python 3

File details

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

File metadata

  • Download URL: scalar_django_ninja-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 0a3c661eb56e85895aee8bc078aa7ff52badb4210cca90a5b3b7113199f6b675
MD5 69b28f329aa54ae4669fc42c167f1076
BLAKE2b-256 eb93b896cafe1c2fd8ba9fec8d54ea1922e91217c18ce1af3e60f4540fbddee4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scalar_django_ninja-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32b18adc1699c77d842450edb9ec40774bbc24d894101d3bf944fd730b61a844
MD5 b4447da79b89c79106abe39184342293
BLAKE2b-256 f27ddce6e9af883d461b70454b7d8ac5a1f9d23b3c2abfa81a3adb2bd4cff6c3

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