:layout: landing

.. figure:: /_static/images/logo-light.svg
   :figclass: light-only
   :width: 700
   :align: center

.. figure:: /_static/images/logo-dark.svg
   :figclass: dark-only
   :width: 700
   :align: center

.. container:: badges
   :name: badges

   .. image:: 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
      :alt: wemake.services
      :target: https://github.com/wemake-services

   .. image:: https://img.shields.io/badge/Modern%20REST-0C4B33?logo=data:image/svg+xml;base64, &color=35544A
      :alt: Modern REST
      :target: https://github.com/wemake-services/django-modern-rest

   .. image:: https://github.com/wemake-services/django-modern-rest/actions/workflows/test.yml/badge.svg?event=push
      :alt: Tests result
      :target: https://github.com/wemake-services/django-modern-rest/actions/workflows/test.yml

   .. image:: https://codecov.io/gh/wemake-services/django-modern-rest/branch/master/graph/badge.svg
      :alt: Codecov
      :target: https://codecov.io/gh/wemake-services/django-modern-rest

   .. image:: https://img.shields.io/badge/no-slop-purple.svg
      :alt: No AI slop
      :target: https://github.com/wemake-services/django-modern-rest/blob/master/.github/AI_POLICY.md

   .. image:: https://static.pepy.tech/personalized-badge/django-modern-rest?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=BRIGHTGREEN&left_text=downloads
      :alt: PyPI Downloads
      :target: https://pepy.tech/projects/django-modern-rest

   .. image:: https://img.shields.io/pypi/pyversions/django-modern-rest.svg
      :alt: Supported Python Version
      :target: https://pypi.org/project/django-modern-rest/

   .. image:: https://img.shields.io/badge/style-wemake-000000.svg
      :alt: Code Style
      :target: https://github.com/wemake-services/wemake-python-styleguide

   .. image:: https://deepwiki.com/badge.svg
      :alt: Ask DeepWiki
      :target: https://deepwiki.com/wemake-services/django-modern-rest

   .. image:: https://img.shields.io/badge/chat-join-blue.svg?logo=telegram
      :alt: Telegram Chat
      :target: https://t.me/django_modern_rest


.. rst-class:: lead

  Modern REST framework for Django with types and async support!

This guide will walk you through all the details of how to install, use,
and extend ``django-modern-rest`` framework.


.. container:: buttons

    :doc:`pages/getting-started`
    `GitHub <https://github.com/wemake-services/django-modern-rest>`_


.. rubric:: Testimonials

.. container:: testimonials

  .. epigraph::

    The one thing I really love about ``django-modern-rest`` is its pluggable
    serializers and validators. Frameworks that are tightly coupled
    with ``pydantic`` can be really painful to work with.

    -- `Kirill Podoprigora <https://github.com/Eclips4>`_, CPython core developer

  .. epigraph::

    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.

    -- `Josiah Kaviani <https://github.com/proofit404>`_, Django core developer

  .. epigraph::

      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.

      -- `Dmitry Dygalo <https://github.com/Stranger6667>`_, author of Schemathesis


.. rubric:: Main features include:

.. grid:: 1 1 2 3
    :class-row: surface
    :padding: 0
    :gutter: 2

    .. grid-item-card:: :octicon:`terminal` REST
      :link: pages/core-concepts
      :link-type: doc

      Semantic REST APIs with 100% typed API and strict schema validation
      for both requests and responses.

      You would never miss an important status code in the docs anymore!

    .. grid-item-card:: :octicon:`zap` Blazingly Fast!
      :link: pages/deep-dive/performance
      :link-type: doc

      Built with performance in mind. Import time optimizations,
      only one validation per request, best ``json`` parsing tools in class.

      And ``msgspec`` support allows users to have
      `x5-15 times faster <https://msgspec.dev/benchmarks>`_
      APIs than the alternatives.

    .. grid-item-card:: :octicon:`star` Sync and Async support
      :link: pages/core-concepts
      :link-type: doc

      Fully utilizes best of the both worlds in ``django``.

      Create your APIs as sync or async, your choice.
      Both ``wsgi`` and ``asgi`` are supported.

    .. grid-item-card:: :octicon:`beaker` Not just schema generation
      :link: pages/openapi/openapi
      :link-type: doc

      Of course, OpenAPI schema generation and modification
      are available out of the box.

      But, there's more: we also provide validation
      and testing tools for your schema!
      Powered by `schemathesis <https://github.com/schemathesis/schemathesis>`_

    .. grid-item-card:: :octicon:`rocket` Still good old Django
      :link: pages/core-concepts
      :link-type: doc

      We don't reinvent the wheel, this is just good old Django.
      We only add fast ``json`` parsing and schema for requests and responses.

      And that's it. You can still use all packages
      and features from regular Django apps.
      No new concepts to learn, no new APIs to be compatible with.

      Just drop this package into any existing Django application!

    .. grid-item-card:: :octicon:`gear` Customizable to the core
      :link: pages/deep-dive/public-api
      :link-type: doc

      Every part of the framework can be customized and extended.

      Since, there's no magic happening, it would be really easy to do.
      Our docs and tests provide multiple examples of that.

      Public API stability is guaranteed from 1.0.0 release.



Contributors
------------

Here are our amazing people who made this project possible.

.. container:: rounded-image

    .. contributors:: wemake-services/django-modern-rest
        :avatars:
        :contributions:
        :names:
        :exclude: dependabot[bot],pre-commit-ci[bot],Copilot


.. toctree::
  :caption: Getting started guides
  :hidden:

  pages/getting-started.rst
  pages/core-concepts.rst
  pages/using-controller/index
  pages/routing.rst
  pages/components/index
  pages/configuration.rst
  pages/plugins.rst
  pages/queryset.rst
  pages/negotiation.rst
  pages/error-handling.rst
  pages/throttling.rst
  pages/middleware.rst
  pages/validation.rst
  pages/reusable-code.rst
  pages/external-views.rst
  pages/integrations.rst
  pages/internationalization.rst
  pages/testing.rst


.. toctree::
  :caption: Auth
  :hidden:

  pages/auth/common.rst
  pages/auth/http-basic.rst
  pages/auth/django-session.rst
  pages/auth/jwt.rst
  pages/auth/token.rst


.. toctree::
  :caption: Streaming
  :hidden:

  pages/streaming/common.rst
  pages/streaming/sse.rst
  pages/streaming/jsonl.rst


.. toctree::
  :caption: OpenAPI
  :hidden:

  pages/openapi/schema.rst
  pages/openapi/openapi.rst
  pages/openapi/openapi-reference.rst


.. toctree::
  :caption: AI and LLMs
  :hidden:

  pages/ai/spec-first.rst
  pages/ai/dmr-from-ninja.rst
  pages/ai/dmr-from-drf.rst


.. toctree::
  :caption: Project structure
  :hidden:

  pages/structure/micro-framework.rst
  pages/structure/sync-and-async.rst


.. toctree::
  :caption: Deep Dive
  :hidden:

  pages/deep-dive/performance.rst
  pages/deep-dive/public-api.rst
  pages/deep-dive/internal-api.rst
  pages/deep-dive/security.rst
  pages/deep-dive/changelog.rst
  pages/deep-dive/contributing.rst


.. toctree::
  :caption: Community
  :hidden:

  pages/community/logos.rst
