--- id: drf-extensions version: "0.8.0" license: BSD license_treatment: permissive maintenance: active --- # drf-extensions — Extensions for Django REST Framework License: permissive · Maintenance: active · Downloads: 2.7M/mo ## 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 above — 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 pip install drf-extensions uv add drf-extensions 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: unspecified - Install friction: low - Maintenance: active - Downloads: 2.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags django rest framework extensions, drf caching decorators, bulk operations rest api, nested routes django, detail serializer mixin, conditional requests drf, rest framework customization, django-rest-framework, api-extensions, caching [View on SkillFed](https://skillfed.io/packages/drf-extensions) · [View on PyPI](https://pypi.org/project/drf-extensions/)