How wemake-services/django-modern-rest works
django-modern-rest is a typed, async-capable REST framework for Django. Its main request path routes a Django request to a controller endpoint, which applies endpoint metadata and security/throttling checks, parses and validates input, then serializes and renders a response. The framework also provides schema-driven OpenAPI generation, streaming formats, and pluggable schema/serialization integrations. The graph combines documented capabilities with source-index references; unsampled subsystem internals and some wiring are therefore represented conservatively.
Main entry points: endpoint.py Endpoint execution · serializer.py Serializer API · routing.py Request routing · controller.py Controller
Components 22
Request handling
- Request routing
dmr/routing.py - Controller
dmr/controller.py - Endpoint execution
dmr/endpoint.py - Endpoint metadata
dmr/metadata.py
Data and responses
- Request parsers
dmr/parsers.py - Request validation
dmr/validation - Serializer API
dmr/serializer.py - Response renderers
dmr/renderers.py - HTTP responses
dmr/response.py - Content negotiation
dmr/negotiation.py
Security controls
- Authentication
dmr/security/base.py - HTTP authentication
dmr/security/http.py - Auth integrations
dmr/security - Request throttling
dmr/throttling
Schema and formats
- OpenAPI collection
dmr/openapi/collector.py - OpenAPI context
dmr/openapi/core/context.py - OpenAPI generators
dmr/openapi/generators - OpenAPI objects
dmr/openapi/objects
Framework extensions
- Streaming responses
dmr/streaming/controller.py - Schema plugins
dmr/plugins - Cursor pagination
dmr/pagination/cursor.py
Other components
- API client
Connections 25
- API client → Request routing: sends request
- Request routing → Controller: dispatches
dmr/routing.py - Controller → Endpoint execution: invokes
dmr/controller.py - Controller → Endpoint metadata: configures
dmr/controller.py - Endpoint execution → Endpoint metadata: reads
dmr/endpoint.py - Endpoint execution → Request parsers: parses input
dmr/endpoint.py - Endpoint execution → Request validation: validates input
dmr/endpoint.py - Endpoint execution → Authentication: authenticates
dmr/endpoint.py - Endpoint execution → Request throttling: checks limits
dmr/endpoint.py - Endpoint execution → Content negotiation: negotiates format
dmr/endpoint.py - Endpoint execution → Serializer API: serializes result
dmr/endpoint.py - Endpoint execution → HTTP responses: builds response
dmr/endpoint.py - Serializer API → Request parsers: deserializes with
dmr/serializer.py - Serializer API → Response renderers: renders with
dmr/serializer.py - Authentication → HTTP authentication: supports scheme
dmr/security/base.py - Authentication → Auth integrations: has integrations
dmr/security/base.py - Request routing → OpenAPI collection: exposes schema
dmr/routing.py - Endpoint execution → OpenAPI collection: registers endpoint
dmr/endpoint.py - OpenAPI collection → OpenAPI context: generates through
- OpenAPI context → OpenAPI generators: uses generators
dmr/openapi/core/context.py - OpenAPI generators → OpenAPI objects: builds specification
dmr/openapi/generators/component_parsers.py - Streaming responses → Endpoint execution: uses endpoint flow
dmr/streaming/controller.py - Streaming responses → Response renderers: uses renderers
dmr/streaming/controller.py - Schema plugins → Serializer API: implements serializers
dmr/plugins/pydantic/serializer.py - Cursor pagination → API client: provides cursors