skillfed

drf-extensions

Extensions for Django REST Framework

drf-extensions v0.8.0 2.7M downloads/30d#2,939 on PyPI1,550
Permissive license BSD Active released

What it is and what it does

drf-extensions is a collection of add-ons for Django REST Framework that fills gaps in the core framework's API design and performance tooling. It provides mixins to use different serializers for list vs. detail views, decorators for HTTP caching and conditional requests, utilities for constructing cache keys, support for nested routes, and helpers for bulk create/update/delete operations. The package is built on top of djangorestframework, packaging, and Django itself, so it integrates directly into your existing DRF viewsets and serializers.

The package is mature and actively maintained, with a long release history since 2013 and recent updates. It's tested against a wide range of Python and Django versions, making it a stable choice for projects that need these common REST API patterns without rolling custom code.

Use it for:

  • Use different serializers for list endpoints versus detail endpoints with a mixin.
  • Cache API responses conditionally based on HTTP headers and request state to reduce database load.
  • Implement bulk create, update, or delete operations on collections in a single request.
  • Define nested resource routes without manual URL configuration.
  • Customize cache key construction to handle complex cache invalidation scenarios.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides mixins, decorators, and utilities that extend Django REST Framework's serializers, viewsets, and caching to support detail serializers, bulk operations, nested routes, and conditional requests.

Yes. drf-extensions is a stable, actively maintained library that solves real problems in Django REST Framework projects—detail serializers, caching, bulk operations, and nested routes are common needs. Low install friction, no security vulnerabilities, permissive license, and broad version support make it a safe addition to any DRF-based API.

Install

drf-extensions on PyPI

pip

pip install drf-extensions

uv

uv add drf-extensions

poetry

poetry add drf-extensions

Installing drf-extensions

Before you install

Low friction install with a pure Python wheel. Actively maintained as of 2026-08-06, tested against modern Python (3.9, 3.10, 3.11, 3.12, 3.13, 3.14) and Django/DRF versions (Django 3.2 to 6.0, DRF 3.12, 3.13, 3.14, 3.15, 3.16). No known security vulnerabilities.

License in practice

BSD license is permissive; you can use, modify, and distribute this package with minimal legal constraints in most commercial and open-source contexts.

Quickstart

pip install drf-extensions

from drf_extensions.mixins import DetailSerializerMixin
from djangorestframework import viewsets

class MyViewSet(DetailSerializerMixin, viewsets.ModelViewSet):
    serializer_class = MySerializer
    serializer_detail_class = MyDetailSerializer

Verify before relying

  • Whether caching and conditional request features work with all cache backends or only specific ones.
  • Performance impact of nested routes and bulk operations on large datasets.
  • Compatibility with third-party DRF packages beyond those explicitly tested.
  • Exact module paths and import patterns for all extension features.

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 3 — djangorestframework, packaging, Django
Maintenance actively maintained — 491 days since the last release
Last repo commit
First released
Downloads 2,684,753/month — #2,939 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: drf_extensions-0.8.0-py2.py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 3.2Framework :: Django :: 4.2Framework :: Django :: 5.2Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP

Tags

django rest framework extensionsdrf caching decoratorsbulk operations rest apinested routes djangodetail serializer mixinconditional requests drfrest framework customization
django-rest-frameworkapi-extensionscaching

More WWW/HTTP packages

urllib3

urllib3 is an HTTP client library that provides…

permissive · top 100 on PyPI

requests

Requests is a Python HTTP library that…

permissive · top 100 on PyPI

h11

h11 is a pure-Python HTTP/1.1 protocol…

permissive · top 100 on PyPI

httpx

HTTPX is a fully featured HTTP client library…

permissive · top 100 on PyPI

httpcore

A minimal low-level HTTP client library that…

permissive · top 100 on PyPI

aiohttp

aiohttp is an async HTTP client and server…

permissive · top 100 on PyPI

drf-rw-serializers

Extends Django REST Framework with separate…

permissive · top 15,000 on PyPI

drf-dynamic-fields

Provides a Django REST Framework mixin that…

permissive · top 15,000 on PyPI

django-dynamic-preferences

Stores and retrieves application settings…

permissive · top 15,000 on PyPI

drf-spectacular-jsonapi

Generates OpenAPI 3 schemas for Django REST…

permissive · top 15,000 on PyPI

djangorestframework-recursive

Adds a RecursiveField to Django REST Framework…

permissive · top 15,000 on PyPI

djangorestframework-role-filters

Adds role-based access control to Django REST…

permissive · top 5,000 on PyPI

djangorestframework-bulk

Adds bulk create, update, and delete operations…

permissive · top 15,000 on PyPI

drf-writable-nested

Extends Django REST Framework serializers to…

permissive · top 15,000 on PyPI

drf-nested-routers

Provides routers and serializer fields for…

permissive · top 5,000 on PyPI

django-braces

Provides reusable mixin classes for Django…

permissive · top 15,000 on PyPI