{"full_name":"vitalik/django-ninja","owner":"vitalik","name":"django-ninja","shard":"1","url":"https://github.com/vitalik/django-ninja","description":"💨  Fast, Async-ready, Openapi, type hints based framework for building APIs","homepage":"https://django-ninja.dev","topics":["python","django","rest-api","openapi","pydantic","swagger","swagger-ui","django-ninja"],"tag_pages":["django","openapi","pydantic","python","rest-api","swagger","swagger-ui"],"language":"Python","license":"MIT","avatar":"https://avatars.githubusercontent.com/u/95222?u=6dc513f42c09a6378a69956b1aaa6d2e35ae248f&v=4","created_at":"2020-05-19T08:48:53Z","pushed_at":"2026-11-10T15:00:37Z","metrics":{"stars":9245,"forks":626,"watchers":62,"issues":1057,"prs":617,"releases":71,"issues_open":86,"issues_closed":971,"prs_open":73,"prs_closed":174,"prs_merged":370,"discussions":172},"growth":{"day":{"stars":-1,"forks":0,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-10","2026-11-11","2026-11-12","2026-11-13","2026-11-14","2026-11-15","2026-11-16"],"stars":[9241,9242,9243,9244,9244,9246,9245],"forks":[627,626,626,626,627,626,626],"watchers":[null,62,62,62,62,62,62],"issues_open":[null,86,86,86,86,86,86],"prs_open":[null,72,72,72,73,73,73]},"boards":{},"same_owner":[],"issues":[{"number":383,"title":"🛑 Russia invaded Ukraine","comments":33,"created_at":"2022-03-02T16:50:23Z"},{"number":789,"title":"How implement permissions like DRF in django-ninja?","comments":18,"created_at":"2023-07-12T11:07:54Z"},{"number":637,"title":"'api-1.0.0' is not a registered namespace","comments":17,"created_at":"2022-12-20T20:05:46Z"},{"number":1306,"title":"[BUG] JSON payload not parsed when using upload with extra fields","comments":12,"created_at":"2024-09-27T21:17:32Z"},{"number":1037,"title":"[BUG] Typing error with Field q kwarg","comments":12,"created_at":"2024-01-05T11:19:22Z"},{"number":1444,"title":"[BUG] Pydantic V2.11 Seems to cause up to x2.5 memory usage to ninja models build","comments":11,"created_at":"2025-04-11T16:42:27Z"},{"number":961,"title":"[BUG] Response generation dramatically slower when using aliases in Ninja v1/Pydantic v2","comments":11,"created_at":"2023-11-26T22:46:46Z"},{"number":333,"title":"Dynamic response schema based on request parameters","comments":11,"created_at":"2022-01-22T00:03:38Z"}],"discussions":[{"number":1785,"title":"⚡ Native B-FAST Binary Renderer for Django Ninja: Sub-microsecond serialization & 89% bandwidth reduction","comments":0,"category":"Show and tell","created_at":"2026-09-24T17:08:31Z"},{"number":1750,"title":"Idempotency middleware for Django Ninja (works out of the box, it's plain ASGI)","comments":0,"category":"Show and tell","created_at":"2026-08-06T20:41:14Z"},{"number":1740,"title":"How to use dynamic keys in schema?","comments":1,"category":"Q&A","created_at":"2026-06-17T10:35:04Z"},{"number":1693,"title":"Should newly added Status class be a generic?","comments":1,"category":"Ideas","created_at":"2026-03-12T15:02:34Z"},{"number":1681,"title":"GlitchTip uses django-ninja with ASGI and real asyncio-native cache, workers","comments":0,"category":"Show and tell","created_at":"2026-02-19T14:11:27Z"},{"number":1672,"title":"Show and tell: Wireup - Type-safe Dependency Injection for Django Ninja","comments":0,"category":"Show and tell","created_at":"2026-02-14T23:03:36Z"},{"number":1664,"title":"FastAPI Voyager now supports Django Ninja, A visualization tool for APIs","comments":0,"category":"Show and tell","created_at":"2026-02-03T23:19:14Z"},{"number":1654,"title":".","comments":0,"category":"Show and tell","created_at":"2026-01-21T12:42:23Z"}],"latest_release":{"name":"","tag":"v1.8.0","published_at":"2026-11-08T10:51:48Z","body":"## What's New\r\n\r\n### Webhooks\r\nYou 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\r\n\r\n### Webhooks\r\nYou 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](https://django-ninja.dev/guide/webhooks/) shows one way to deliver them with Django tasks.\r\n\r\n```python\r\nfrom ninja import NinjaAPI, Router, Schema\r\n\r\napi = NinjaAPI()\r\n\r\n@api.webhook(\"order.paid\")\r\nclass OrderPaid(Schema):\r\n    id: int\r\n    total: Decimal\r\n\r\nrouter = Router(tags=[\"orders\"])\r\n\r\n@router.webhook  # name defaults to the class name: \"OrderShipped\"\r\nclass OrderShipped(Schema):\r\n    id: int\r\n```\r\n\r\n### New documentation (and docs for AI assistants)\r\nThe docs at [django-ninja.dev](https://django-ninja.dev) are reorganized into four sections:\r\n- **Quick Start**: build an events API in three pages\r\n- **Tutorial**: build TaskFlow, a team task tracker, in eight parts. It covers relations, validation, JWT auth and permissions, filtering, uploads, testing, OpenAPI polish and versioning\r\n- **Guide**: one short page per topic, and every example was run against the current code\r\n- **About**\r\n\r\nThe docs now include files for LLMs. Point your coding assistant at [`/llms.txt`](https://django-ninja.dev/llms.txt), which has usage notes and a link to every page, or at [`/llms-full.txt`](https://django-ninja.dev/llms-full.txt), which is the whole Guide in one file. Every page is also served as raw Markdown, e.g. [`/guide/routers.md`](https://django-ninja.dev/guide/routers.md).\r\n\r\n### `register_field()` accepts field classes\r\nA custom Django field that subclasses a built-in one inherits its internal type, so registering it by name (`\"UUIDField\"`) would change every `UUIDField`. You can now register the field class itself:\r\n\r\n```python\r\nfrom typing import Annotated\r\nfrom pydantic import BeforeValidator\r\nfrom ninja.orm import register_field\r\n\r\nclass PublicIDField(models.UUIDField):\r\n    def from_db_value(self, value, expression, connection):\r\n        return PublicID(value)\r\n\r\nregister_field(PublicIDField, Annotated[str, BeforeValidator(str)])\r\n```\r\n\r\nThe registration also applies to subclasses, and the most specific class wins. It also covers ForeignKey and OneToOne fields that point at that field. Forward FK and OneToOne fields now take their type from the `to_field` target instead of always using the related model's pk.\r\n\r\n### Optional schema parameters\r\nAn `Optional` schema used as a `Query`, `Header` or `Form` param now falls back to its default when none of its fields are sent:\r\n\r\n```python\r\nclass Filters(Schema):\r\n    city: str\r\n    year: int = 2026\r\n\r\n@api.get(\"/events\")\r\ndef events(request, filters: Filters | None = Query(None)):\r\n    ...\r\n\r\n# GET /events            -> filters is None   (was 422)\r\n# GET /events?city=Kyiv  -> Filters(city=\"Kyiv\", year=2026)\r\n```\r\n\r\n### `Body` params next to files\r\nWhen you mix `Body` params with `File` or `Form`, each multipart part is now read the way Swagger and generated clients send it. Primitive types (`str`, `int`, `date`, `Enum`, `EmailStr`, ...) are read as plain text, and objects and arrays are read as JSON:\r\n\r\n```python\r\n@api.post(\"/upload\")\r\ndef upload(\r\n    request,\r\n    file: File[UploadedFile],\r\n    note: str = Body(...),\r\n    day: date = Body(...),\r\n    meta: dict[str, int] | None = Body(None),\r\n):\r\n    ...\r\n\r\n# note='say \"hi\"'  day=2024-01-02  meta='{\"a\": 1}'  -> 200 (quoted strings and dates used to give 400)\r\n```\r\n\r\n### ModelSchema improvements\r\nModel fields now always come first, in model order, followed by your custom fields. A field you declare on the schema is used as-is, so a third-party model field that Ninja can't convert no longer breaks `fields = \"__all__\"`:\r\n\r\n`","is_prerelease":false},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}