// the find
vitalik/django-ninja
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
Django Ninja adds a FastAPI-style decorator API on top of Django, giving you Pydantic validation, automatic OpenAPI docs, and async support without leaving the Django ecosystem. It's aimed at Django shops that want type-safe APIs with less boilerplate than DRF. If you're already running Django and don't want to rewrite everything in FastAPI, this is the pragmatic middle path.
The Django ORM integration is genuinely useful — `create_schema` generates Pydantic models directly from Django models, so you're not maintaining two parallel representations. The test coverage is thorough: there are separate test files for async, auth inheritance, routers, pagination variants, and discriminated unions, which signals the project takes correctness seriously. Router composition works the same way as FastAPI's, so teams already familiar with that pattern can onboard quickly. The bundled Swagger UI and Redoc assets are served statically without an external CDN dependency by default, which matters in locked-down environments.
Class-based views are still in the proposals directory — CBVs are how most Django code is organized, and their absence means ninja routes often end up as flat function soup in large apps. The ORM schema generation has known rough edges with complex relations and custom field types; `create_schema` is convenient until it isn't, and then you're fighting it. The benchmark screenshot in the README is against DRF with no configuration hardening, which is a soft comparison. Async support depends on Django's own async ORM, which still can't do everything the sync ORM can, so 'async-ready' on the tin is truer than it used to be but still has gaps in practice.