drf-orjson-renderer
Django RestFramework JSON Renderer Backed by orjson
What it is and what it does
drf_orjson_renderer replaces Django REST Framework's default JSON renderer with orjson, a Rust-backed serialization library designed for speed and correctness. It acts as a drop-in renderer and parser that you configure in your Django settings to handle JSON serialization across your API endpoints.
The package bridges the performance benefits of orjson with DRF's browsable API: when clients request `application/json`, responses serialize at orjson's speed; when they request `text/html` (browsable API), the renderer automatically pretty-prints output for readability. It includes a default serialization handler for common Django objects and allows you to override it with custom logic for domain-specific types. It also provides a backwards-compatible encoder for NumPy types.
Use it for:
- Replace DRF's JSON renderer in a high-traffic API to reduce serialization overhead and latency.
- Maintain developer experience with the browsable API while gaining orjson's performance for production JSON clients.
- Serialize NumPy arrays or dataclasses in API responses by configuring orjson options in settings.
- Parse incoming JSON payloads faster using ORJSONParser as your default parser class.
- Customize serialization behavior for complex domain objects by overriding the default function in view context.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a high-performance JSON renderer and parser for Django REST Framework using orjson, a Rust-backed library, while maintaining pretty-printed output for the browsable API.
Yes, if you use Django REST Framework and want faster JSON serialization with minimal setup. The package is stable (MIT licensed, no known vulnerabilities), has low install friction, and requires only standard DRF configuration. The aging maintenance status is not a blocker—it's a mature, focused tool with a narrow scope. Install it if JSON performance is a concern; skip it if your API traffic is low or you have no performance issues with the default renderer.
Install
drf-orjson-renderer on PyPI
pip
pip install drf-orjson-rendereruv
uv add drf-orjson-rendererpoetry
poetry add drf-orjson-rendererInstalling drf-orjson-renderer
Before you install
Low friction: pure Python wheel with three lightweight runtime dependencies (django, djangorestframework, orjson). Last release 240 days ago; repository active and not archived with 91 stars. Status marked as aging but no recent maintenance concerns evident.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial or private projects with minimal restrictions—only requiring attribution.
Quickstart
pip install drf-orjson-renderer
# In settings.py
REST_FRAMEWORK = {
"DEFAULT_RENDERER_CLASSES": (
"drf_orjson_renderer.renderers.ORJSONRenderer",
"rest_framework.renderers.BrowsableAPIRenderer",
),
}
Requires Django and djangorestframework already installed; orjson is a compiled Rust dependency but ships as a pre-built wheel.
Verify before relying
- Whether performance gains over standard DRF JSON renderer are measurable in typical Django applications.
- Compatibility with custom serializer fields or third-party DRF extensions beyond what the description covers.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — django, djangorestframework, orjson |
| Maintenance | aging — 240 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 398,093/month — #6,955 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: drf_orjson_renderer-1.8.0-py3-none-any.whl
Keywords: drf_orjson_renderer, rest_framework, orjson
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
orjsonorjson is a fast JSON serialization and…
copyleft · top 1,000 on PyPI
flask-orjsonReplaces Flask's default JSON encoder with…
permissive · top 15,000 on PyPI
djangorestframework-csvAdds CSV rendering and parsing capabilities to…
permissive · top 5,000 on PyPI
drf-excelAdds an Excel spreadsheet (xlsx) renderer to…
permissive · top 15,000 on PyPI
djangorestframework-camel-caseConverts JSON field names between camelCase and…
permissive · top 15,000 on PyPI
adrfAdds async/await support to Django REST…
permissive · top 15,000 on PyPI
djangorestframework-xmlAdds XML parsing and rendering support to…
permissive · top 15,000 on PyPI
drf-dynamic-fieldsProvides a Django REST Framework mixin that…
permissive · top 15,000 on PyPI
django-rest-framework-docsGenerates browsable documentation and an…
permissive · top 15,000 on PyPI
djangorestframework-yamlAdds YAML parsing and rendering support to…
permissive · top 15,000 on PyPI