{
  "markdown": "<p align=\"center\">\n   <a href=\"https://django-modern-rest.readthedocs.io/en/latest/\">\n      <picture>\n         <source srcset=\"https://raw.githubusercontent.com/wemake-services/django-modern-rest/master/docs/_static/images/logo-dark.svg\" media=\"(prefers-color-scheme: dark)\">\n         <img src=\"https://raw.githubusercontent.com/wemake-services/django-modern-rest/master/docs/_static/images/logo-light.svg#gh-light-mode-only\" alt=\"Modern REST Logo - Light\" width=\"100%\" height=\"auto\" />\n      </picture>\n   </a>\n</p>\n\n<p align=\"center\">\n  <em>Modern REST framework for Django with types and async support!</em>\n</p>\n\n<div align=\"center\">\n\n[![wemake.services](https://img.shields.io/badge/%20-wemake.services-green.svg?label=%20&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAbUExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP%2F%2F%2F5TvxDIAAAAIdFJOUwAjRA8xXANAL%2Bv0SAAAADNJREFUGNNjYCAIOJjRBdBFWMkVQeGzcHAwksJnAPPZGOGAASzPzAEHEGVsLExQwE7YswCb7AFZSF3bbAAAAABJRU5ErkJggg%3D%3D)](https://wemake-services.github.io)\n[![Modern REST](https://img.shields.io/badge/Modern%20REST-0C4B33?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTA4MCIgaGVpZ2h0PSIxMDgwIiB2aWV3Qm94PSIwIDAgMTA4MCAxMDgwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMiA3MDQuMDJMMTQ1LjQ1OSA0NjYuMTlMMjc3Ljg4MyA3MDQuMDJMMTQ1LjQ1OSA5NDEuODQ5TDIgNzA0LjAyWiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTE0NS40NTkgOTQxLjg0OUwyIDcwNC4wMkgyNzcuODgzTDE0NS40NTkgOTQxLjg0OVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik02NzguOTQ4IDcwNC4wMzVMMzQxLjIzIDEzOEwyMjcuMDcxIDMyOC4yNjRMNDM2LjM2MiA3MDQuMDM1TDMwMy4xNzcgOTQxLjg2NEg1MzYuMjVMNjc4Ljk0OCA3MDQuMDM1WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTY3OC45MzcgNzA0LjAyNkg0MzYuMzVMMzAzLjE2NiA5NDEuODU2SDUzNi4yMzlMNjc4LjkzNyA3MDQuMDI2WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTEwNzguMTcgNzA0LjAzNUw3NDAuNDUxIDEzOEw2MjYuMjkzIDMyOC4yNjRMODM1LjU4MyA3MDQuMDM1TDcwMi4zOTkgOTQxLjg2NEg5MzUuNDcyTDEwNzguMTcgNzA0LjAzNVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMDc4LjE3IDcwNC4wMzVIODM1LjU4M0w3MDIuMzk5IDk0MS44NjRIOTM1LjQ3MkwxMDc4LjE3IDcwNC4wMzVaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K&color=35544A)](https://github.com/wemake-services/django-modern-rest)\n[![Tests Result](https://github.com/wemake-services/django-modern-rest/actions/workflows/test.yml/badge.svg?event=push)](https://github.com/wemake-services/django-modern-rest/actions/workflows/test.yml)\n[![Codecov](https://codecov.io/gh/wemake-services/django-modern-rest/branch/master/graph/badge.svg)](https://codecov.io/gh/wemake-services/django-modern-rest)\n[![No AI slop](https://img.shields.io/badge/no-slop-purple.svg)](https://github.com/wemake-services/django-modern-rest/blob/master/.github/AI_POLICY.md)\n[![PyPI Downloads](https://static.pepy.tech/personalized-badge/django-modern-rest?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=BRIGHTGREEN&left_text=downloads)](https://pepy.tech/projects/django-modern-rest)\n[![Supported Python Version](https://img.shields.io/pypi/pyversions/django-modern-rest.svg)](https://pypi.org/project/django-modern-rest/)\n[![Code Style](https://img.shields.io/badge/style-wemake-000000.svg)](https://github.com/wemake-services/wemake-python-styleguide)\n[![Ask DeepWiki](https://img.shields.io/badge/ask-deepwiki-blue)](https://deepwiki.com/wemake-services/django-modern-rest)\n[![Telegram group](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Ftg.chirizxc.workers.dev%2Fdjango_modern_rest&query=%24.members_summary_pretty&label=t.me%2Fdjango_modern_rest&color=272170&gradient=9D50BB%2C+6E48AA&valueColor=ffffff&labelTextColor=ffffff&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BPHBhdGggZD0iTTEyIDI0YzYuNjI3IDAgMTItNS4zNzMgMTItMTJTMTguNjI3IDAgMTIgMCAwIDUuMzczIDAgMTJzNS4zNzMgMTIgMTIgMTJaIiBmaWxsPSJ1cmwoI2EpIi8%2BPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01LjQyNSAxMS44NzFhNzk2LjQxNCA3OTYuNDE0IDAgMCAxIDYuOTk0LTMuMDE4YzMuMzI4LTEuMzg4IDQuMDI3LTEuNjI4IDQuNDc3LTEuNjM4LjEgMCAuMzIuMDIuNDcuMTQuMTIuMS4xNS4yMy4xNy4zMy4wMi4xLjA0LjMxLjAyLjQ3LS4xOCAxLjg5OC0uOTYgNi41MDQtMS4zNiA4LjYyMi0uMTcuOS0uNSAxLjE5OS0uODE5IDEuMjI5LS43LjA2LTEuMjI5LS40Ni0xLjg5OC0uOS0xLjA2LS42ODktMS42NDktMS4xMTktMi42NzgtMS43OTgtMS4xOS0uNzgtLjQyLTEuMjA5LjI2LTEuOTA4LjE4LS4xOCAzLjI0Ny0yLjk3OCAzLjMwNy0zLjIyOC4wMS0uMDMuMDEtLjE1LS4wNi0uMjEtLjA3LS4wNi0uMTctLjA0LS4yNS0uMDItLjExLjAyLTEuNzg4IDEuMTQtNS4wNTYgMy4zNDgtLjQ4LjMzLS45MDkuNDktMS4yOTkuNDgtLjQzLS4wMS0xLjI0OC0uMjQtMS44NjgtLjQ0LS43NS0uMjQtMS4zNDktLjM3LTEuMjk5LS43OS4wMy0uMjIuMzMtLjQ0Ljg5LS42NjlaIiBmaWxsPSIjZmZmIi8%2BPGRlZnM%2BPGxpbmVhckdyYWRpZW50IGlkPSJhIiB4MT0iMTEuOTkiIHkxPSIwIiB4Mj0iMTEuOTkiIHkyPSIyMy44MSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIHN0b3AtY29sb3I9IiMyQUFCRUUiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMyMjlFRDkiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48L3N2Zz4K)](https://t.me/django_modern_rest)\n</div>\n\n## Features\n\n- [x] [Blazingly fast](https://django-modern-rest.readthedocs.io/en/latest/pages/deep-dive/performance.html)\n- [x] Supports async Django without any `sync_to_async` / `async_to_sync` calls inside, tested to work with free-threading builds\n- [x] Supports `pydantic2`, `msgspec`, `attrs`, `dataclasses`, `TypedDict` as model schemas, but not bound to any of these libraries\n- [x] Fully typed and checked with `mypy`, `pyright`, `ty`, and `pyrefly` in strict modes\n- [x] Supports content negotiation, has default implementations for `json`, `msgpack`, SSE, Json Lines, and more\n- [x] Strict schema validation of both requests and responses, including errors\n- [x] Supports OpenAPI 3.1 / 3.2 semantic schema generation out of the box\n- [x] Supports all your existing `django` primitives and packages, no custom runtimes\n- [x] Great testing tools with [schemathesis](https://github.com/schemathesis/schemathesis), [polyfactory](https://github.com/litestar-org/polyfactory), [tracecov](https://django-modern-rest.readthedocs.io/en/latest/pages/testing/tracecov.html), bundled `pytest` plugin, and default Django's testing primitives\n- [x] 100% test coverage with 4000+ of carefully designed unit, integration, typing, and property-based tests on different databases and caches\n- [x] High [security standards](https://github.com/wemake-services/django-modern-rest/blob/master/.github/SECURITY.md)\n- [x] Built [by the community](https://github.com/wemake-services/django-modern-rest/graphs/contributors) for the community, not a single-person project\n- [x] Great [docs](https://django-modern-rest.readthedocs.io/en/latest/)\n- [x] No AI slop, but [built for the LLM era](https://django-modern-rest.readthedocs.io/en/latest/pages/getting-started.html#llms-support)\n- [x] No emojis 🌚️️\n\n---------\n\n<p align=\"center\">\n   <a href=\"https://django-modern-rest.readthedocs.io/en/latest/pages/deep-dive/performance.html#sync\"><picture>\n         <source srcset=\"docs/_static/images/benchmarks/sync-dark.svg\" media=\"(prefers-color-scheme: dark)\">\n         <img src=\"docs/_static/images/benchmarks/sync-light.svg#gh-light-mode-only\" alt=\"Sync benchmark\" width=\"49%\" /></picture></a>\n   <a href=\"https://django-modern-rest.readthedocs.io/en/latest/pages/deep-dive/performance.html#async\"><picture>\n         <source srcset=\"docs/_static/images/benchmarks/async-dark.svg\" media=\"(prefers-color-scheme: dark)\">\n         <img src=\"docs/_static/images/benchmarks/async-light.svg#gh-light-mode-only\" alt=\"Async benchmark\" width=\"49%\" /></picture></a>\n</p>\n\n\n## Testimonials\n\n> The one thing I really love about **django-modern-rest** is its pluggable\n> serializers and validators. Frameworks that are tightly coupled\n> with **pydantic** can be really painful to work with.\n\n— **[Kirill Podoprigora](https://github.com/Eclips4)**, CPython core developer\n\n> Using `django-modern-rest` has been a game-changer for my productivity. The strict type safety and schema validation for both requests and responses mean I spend less time debugging and more time building.\n\n— **[Josiah Kaviani](https://github.com/proofit404)**, Django core developer\n\n> I rarely see frameworks that treat their OpenAPI schema as a first-class citizen. `django-modern-rest` not only generates a schema that accurately reflects your code, but also gives you the tools to verify it.\n\n— **[Dmitry Dygalo](https://github.com/Stranger6667)**, author of Schemathesis\n\n## Installation\n\nWorks for:\n- CPython 3.11+ or PyPy 3.11+\n- Django 5.0, 5.1, 5.2, 6.0, 6.1\n\n```bash\npip install django-modern-rest\n```\n\nThere are several included extras:\n- `'django-modern-rest[msgspec]'` provides [`msgspec`](https://github.com/msgspec/msgspec) support\n  and the fastest json parsing, recommended to be **always** included\n- `'django-modern-rest[pydantic]'` provides [`pydantic`](https://github.com/pydantic/pydantic) support\n- `'django-modern-rest[attrs]'` provides [`attrs`](https://github.com/python-attrs/attrs) support\n- `'django-modern-rest[jwt]'` provides [`pyjwt`](https://github.com/jpadilla/pyjwt) auth support\n- `'django-modern-rest[openapi]'` provides `OpenAPI` [schema validation](https://github.com/python-openapi/openapi-spec-validator),\n  `yaml` OpenAPI view,\n  and generates better OpenAPI examples with [`polyfactory`](https://github.com/litestar-org/polyfactory)\n\n\n## Example\n\nThe shortest example [(click here to copy the whole file)](https://github.com/wemake-services/django-modern-rest/blob/master/docs/examples/getting_started/pydantic_controller.py):\n\n```python\n>>> import uuid\n>>> import pydantic\n>>> from dmr import Body, Controller, Headers\n>>> # Or use `dmr.plugins.msgspec` or write your own!\n>>> from dmr.plugins.pydantic import PydanticFastSerializer\n\n>>> class UserCreateModel(pydantic.BaseModel):\n...     email: str\n\n>>> class UserModel(UserCreateModel):\n...     uid: uuid.UUID\n...     consumer: str\n\n>>> class HeaderModel(pydantic.BaseModel):\n...     consumer: str = pydantic.Field(alias='X-API-Consumer')\n\n>>> class UserController(Controller[PydanticFastSerializer]):\n...     async def post(  # <- can be sync as well!\n...         self,\n...         parsed_body: Body[UserCreateModel],\n...         parsed_headers: Headers[HeaderModel],\n...     ) -> UserModel:\n...         \"\"\"All added props have the correct runtime and static types.\"\"\"\n...         return UserModel(\n...             uid=uuid.uuid4(),\n...             email=parsed_body.email,\n...             consumer=parsed_headers.consumer,\n...         )\n\n```\n\nAnd then route this controller in your `urls.py`:\n\n```python\n>>> from django.urls import path\n>>> from dmr.routing import Router\n\n>>> router = Router(\n...     'api/',\n...     [\n...         path('user/', UserController.as_view(), name='users'),\n...     ],\n... )\n>>> urlpatterns = [\n...     router.to_urlpatterns(namespace='api'),\n... ]\n\n```\n\nDone! Now you have your shiny API with 100% type\nsafe validation and interactive docs.\n\nNext steps:\n- [The full documentation](https://django-modern-rest.readthedocs.io/en/latest/) has everything you need to get started!\n- [wemake-django-template](https://github.com/wemake-services/wemake-django-template) can be used to jump-start your new project with `django-modern-rest`!\n- [awesome-django-modern-rest](https://github.com/kondratevdev/awesome-django-modern-rest) - a curated list of resources related to `django-modern-rest`!\n\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=wemake-services/django-modern-rest)](https://github.com/wemake-services/django-modern-rest/graphs/contributors)\n\n\n## License\n\n[MIT](https://github.com/wemake-services/django-modern-rest/blob/master/LICENSE)\n\n\n## Credits\n\nThis project was generated with [`wemake-python-package`](https://github.com/wemake-services/wemake-python-package). Current template version is: [e1fcf312d7f715323dcff0d376a40b7e3b47f9b7](https://github.com/wemake-services/wemake-python-package/tree/e1fcf312d7f715323dcff0d376a40b7e3b47f9b7). See what is [updated](https://github.com/wemake-services/wemake-python-package/compare/e1fcf312d7f715323dcff0d376a40b7e3b47f9b7...master) since then.\n",
  "bytes": 11998,
  "sha": "d9f413f6b508b849521853a3056081306475340169183af479cd516a1fbdba2d",
  "repo_slug": "wemake-services/django-modern-rest",
  "fonte": "repo",
  "truncated": false,
  "api": "https://api.agentalog.com/api/listings/skl_wemake_services_django_modern_rest_dmr_4a167c94/readme"
}