django-ninja
Installation
SKILL.md
Django Ninja API Endpoints
Opinionated conventions for building APIs with Django Ninja.
Structure
- Place all endpoints in
api.pyfiles - 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.