djangorestframework-datatables
Seamless integration between Django REST framework and Datatables (https://datatables.net)
What it is and what it does
This package bridges Django REST Framework and the Datatables JavaScript library by providing a custom renderer and filter backend that translate Datatables' server-side request format into DRF-compatible queries. When you add the DatatablesRenderer to your REST_FRAMEWORK settings and call your existing API with `?format=datatables`, it returns JSON structured exactly as Datatables expects, handling search terms, column filters, sort order, and pagination automatically.
Your API remains unchanged and fully functional for non-Datatables clients—the Datatables format is opt-in via the query parameter. The package handles field serialization, nested relationships, and provides configuration options like `datatables_always_serialize` to control which fields appear in the response regardless of client requests.
Use it for:
- Render Django model data in an interactive HTML table with server-side search, sort, and pagination without writing a separate API.
- Add Datatables UI to an existing Django REST Framework API by enabling the format parameter on current viewsets.
- Filter and display related model fields (e.g., artist.name) in a Datatables column with automatic ORM query handling.
- Support POST requests from Datatables clients while keeping the same API endpoint for GET requests.
- Optimize large dataset display by offloading pagination and filtering to the server instead of loading all rows client-side.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds server-side Datatables support to Django REST Framework APIs, enabling searching, filtering, ordering, and pagination through a single `?format=datatables` query parameter.
Yes. This package solves a specific, common problem—integrating Datatables with Django REST Framework—with low install friction, active maintenance, no known vulnerabilities, and a permissive license. It's production-stable (Development Status 5) and widely used (top 15000 PyPI packages). Install it if you need server-side Datatables support for a DRF project.
Install
djangorestframework-datatables on PyPI
pip
pip install djangorestframework-datatablesuv
uv add djangorestframework-datatablespoetry
poetry add djangorestframework-datatablesInstalling djangorestframework-datatables
Before you install
Low friction: pure Python wheel with a single runtime dependency (djangorestframework). Actively maintained with recent releases; last commit 2026-06-24 and version 0.7.2 released 2024-06-14 with Django 5.0/5.1 support.
License in practice
MIT license (permissive): you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install djangorestframework-datatables
# In Django settings.py, add to INSTALLED_APPS:
# 'rest_framework_datatables'
# Configure REST_FRAMEWORK with DatatablesRenderer, DatatablesFilterBackend, and DatatablesPageNumberPagination
# Call your API with ?format=datatables to get Datatables-compatible JSON
Requires Django (3.2, 4.1, 4.2, 5.0, 5.1) and Django REST Framework (3.14) to be installed and configured.
Verify before relying
- Whether the package works with Django REST Framework versions other than 3.14, or if 3.14 is the only supported version.
- Performance characteristics when handling large result sets or complex nested serializers.
- Compatibility with custom Datatables client-side plugins beyond the documented YADCF example.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — djangorestframework |
| Maintenance | actively maintained — 791 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 218,560/month — #9,339 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: djangorestframework_datatables-0.7.2-py2.py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
dj-datatables-viewProvides a Django base view for server-side…
permissive · top 15,000 on PyPI
djangorestframework-jsonapiAdapts Django REST framework to output…
permissive · top 15,000 on PyPI
django-datatables-viewProvides a Django view base class that handles…
permissive · top 15,000 on PyPI
django-elasticsearch-dsl-drfProvides Django REST framework views,…
copyleft · top 15,000 on PyPI
djangorestframework-filtersExtends Django REST Framework with advanced…
permissive · top 15,000 on PyPI
django-filterDjango-filter adds dynamic QuerySet filtering…
permissive · top 5,000 on PyPI
django-cursor-paginationImplements cursor-based pagination for Django…
permissive · top 15,000 on PyPI
djangorestframeworkBuilds web APIs on top of Django with…
permissive · top 1,000 on PyPI
djangorestframework-csvAdds CSV rendering and parsing capabilities to…
permissive · top 5,000 on PyPI
djangorestframework-yamlAdds YAML parsing and rendering support to…
permissive · top 15,000 on PyPI