vitalik /django-ninja

💨 Fast, Async-ready, Openapi, type hints based framework for building APIs

★ 9,245⑂ 626👁 62⑃ 617● 1,057▤ 71
PythonMITCreated 2020-05-19django-ninja.dev
Download: v1.8.0django-ninja-1.8.0 ↓1.8.02026-11-08
-1
Daily
9,245
stars
626
forks
62
watchers
617
prs
1,057
issues
71
releases

README

^ Please read ^





  


    Fast to learn, fast to code, fast to run



!Test
!Coverage



 Django Ninja - Fast Django REST Framework

Django Ninja is a web framework for building APIs with Django and Python 3.6+ type hints.


 Key features:

  - Easy: Designed to be easy to use and intuitive.
  - FAST execution: Very high performance thanks to Pydantic and async support.
  - Fast to code: Type hints and automatic docs lets you focus only on business logic.
  - Standards-based: Based on the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema.
  - Django friendly: (obviously) has good integration with the Django core and ORM.
  - Production ready: Used by multiple companies on live projects (If you use django-ninja and would like to publish your feedback, please email [email protected]).



!Django Ninja REST Framework

Documentation: https://django-ninja.dev

---

 Installation


pip install django-ninja




 Usage


In your django project next to urls.py create new api.py file:

Python
from ninja import NinjaAPI

api = NinjaAPI()


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



Now go to urls.py and add the following:


Python hl_lines="3 7"
...
from .api import api

urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/", api.urls),   http://127.0.0.1:8000/api/docs

You will see the automatic interactive API documentation (provided by Swagger UI or Redoc):

!Swagger UI


 Sponsors



Become a sponsor



 What next?

 - Read the full documentation here - https://django-ninja.dev
 - To support this project, please give star it on Github. !github star
 - Share it via Twitter
 - If you already using django-ninja, please share your feedback to [email protected]

Top issues

Discussions

Latest release

v1.8.0 v1.8.0 2026-11-08
What's New

 Webhooks
You can now document the webhooks your API sends. Decorate the payload Schema with @api.webhook or @router.webhook and it appears in the OpenAPI 3.1 webh What's New

 Webhooks
You can now document the webhooks your API sends. Decorate the payload Schema with @api.webhook or @router.webhook and it appears in the OpenAPI 3.1 webhooks section, so Swagger and Redoc show it next to your operations. This is documentation only: Ninja doesn't send anything. The guide shows one way to deliver them with Django tasks.

python
from ninja import NinjaAPI, Router, Schema

ap

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON