💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
See the codeFast to learn, fast to code, fast to run
Django Ninja is a web framework for building APIs with Django and Python 3.6+ type hints.
Key features:

Documentation: https://django-ninja.dev
pip install django-ninja
In your django project next to urls.py create new api.py file:
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:
...
from .api import api
urlpatterns = [
path("admin/", admin.site.urls),
path("api/", api.urls), # <---------- !
]
That's it !
Now you've just created an API that:
/api/adda and bNow go to http://127.0.0.1:8000/api/docs
You will see the automatic interactive API documentation (provided by Swagger UI or Redoc):


Overall
Maintained
Code review
PyPI
Latest release
Releases this year
(top 24 of 74)
1,131 followers · starred Feb 2025
2,884 followers · starred Dec 2020
1,230 followers · starred Apr 2021
130 followers · starred Jan 2025
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
See the codeFast to learn, fast to code, fast to run
Django Ninja is a web framework for building APIs with Django and Python 3.6+ type hints.
Key features:

Documentation: https://django-ninja.dev
pip install django-ninja
In your django project next to urls.py create new api.py file:
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:
...
from .api import api
urlpatterns = [
path("admin/", admin.site.urls),
path("api/", api.urls), # <---------- !
]
That's it !
Now you've just created an API that:
/api/adda and bNow go to http://127.0.0.1:8000/api/docs
You will see the automatic interactive API documentation (provided by Swagger UI or Redoc):


Overall
Maintained
Code review
PyPI
Latest release
Releases this year
(top 24 of 74)
1,131 followers · starred Feb 2025
2,884 followers · starred Dec 2020
1,230 followers · starred Apr 2021
130 followers · starred Jan 2025