skillfed

drf-orjson-renderer

Django RestFramework JSON Renderer Backed by orjson

drf-orjson-renderer v1.8.0 398.1K downloads/30d#6,955 on PyPI91
Permissive license MIT AGING released

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-renderer

uv

uv add drf-orjson-renderer

poetry

poetry add drf-orjson-renderer

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

django rest framework json rendererorjson serializer drffast json parsing djangodrf json performancerust-backed json rendererdjango api json optimizationbrowsable api json formatting
performance-optimizationjson-serializationrest-api

More Dynamic Content packages