django-ninja

Installation
SKILL.md

Django Ninja API Endpoints

Opinionated conventions for building APIs with Django Ninja.

Structure

  • Place all endpoints in api.py files
  • Create a router per module: router = Router(tags=["module_name"])
  • Keep endpoints as thin wrappers that call service functions for all business logic

One API instance

Construct NinjaAPI exactly once, in the project's root urls.py. Ninja refuses a second instance sharing the same version, so tests and scripts import the existing one (from myproject.urls import api) instead of building their own.

Routers carry no prefix

Installs
34
GitHub Stars
4
First Seen
May 9, 2026