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
Sumary
The easiest way to render a modern and beautiful API reference based on your Django Ninja OpenAPI document.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scalar_django_ninja-0.1.2.tar.gz.
File metadata
- Download URL: scalar_django_ninja-0.1.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43aa8ab235c2f07ae3459a8383972f27e4ab9dc18ddca16a0e2c61a0bf15e346
|
|
| MD5 |
b1dcb979ebcc780f8e534255caa55b65
|
|
| BLAKE2b-256 |
6461839295623d194401de18d6149290812b84850166e1a597d14db52ff5e4dd
|
File details
Details for the file scalar_django_ninja-0.1.2-py3-none-any.whl.
File metadata
- Download URL: scalar_django_ninja-0.1.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d692b6b7094f4127cf8ad650b131f6c155b1172dc60619c58f64e3d93f4cafc
|
|
| MD5 |
238fb361822c33cbdd94a69cf2bb78b5
|
|
| BLAKE2b-256 |
bdcfe2725f6ec47e69d2979f29dba2f1c01de510a2234c63967da8c6e7504668
|