django-model-utils
Django model mixins and utilities
What it is and what it does
django-model-utils is a collection of reusable model mixins and field types that extend Django's built-in model capabilities. It provides utilities like TimeStampedModel (automatically adds created/modified timestamps), SoftDeletableModel (logical deletion without removing data), FieldTracker (monitors field changes), and StatusField (manages state transitions). It also includes managers for model inheritance queries and utilities for working with choices and UUID fields.
The library is designed to reduce boilerplate in common Django patterns. Rather than reimplementing field tracking or soft-delete logic in every project, developers import the relevant mixin or field type into their models. It has minimal dependencies—only Django itself—and integrates directly into Django's ORM, so queries and migrations work as expected. The package is actively maintained, supports current Django and Python versions, and carries no known security vulnerabilities.
Use it for:
- Add automatic created/modified timestamps to models without writing custom save() logic.
- Implement soft-delete functionality where records are marked deleted but retained in database.
- Track which fields on a model instance have changed since it was loaded or last saved.
- Define status or state fields with predefined choices and automatic change-date tracking.
- Query model inheritance hierarchies efficiently without N+1 queries.
- Generate URL-safe tokens for password resets or one-time links.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides reusable model mixins and field utilities for Django applications, including soft-delete models, field tracking, status management, and inheritance helpers.
Yes. django-model-utils is a well-maintained, widely-used library that solves genuine repetitive problems in Django development. It has low install friction, no security vulnerabilities, a permissive license, and active support for current Django and Python versions. Install it if your project uses Django and you need any of its utilities—field tracking, soft deletes, timestamped models, or status management.
Install
django-model-utils on PyPI
pip
pip install django-model-utilsuv
uv add django-model-utilspoetry
poetry add django-model-utilsInstalling django-model-utils
Before you install
Low friction install with a single dependency on Django. Actively maintained with recent releases and commits, supporting Django 3.2 through 5.1 and Python 3.8 through 3.12.
License in practice
BSD permissive license allows use in commercial and open-source projects with minimal restrictions; attribution required.
Quickstart
pip install django-model-utils
from django_model_utils.models import TimeStampedModel
from django_model_utils.fields import StatusField
class Article(TimeStampedModel):
status = StatusField()
Requires Django 3.2 or later and Python 3.8 or later.
Verify before relying
- Specific performance characteristics of FieldTracker on large datasets or complex model hierarchies.
- Compatibility edge cases with Django async ORM features in Django 4.1+.
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Django |
| Maintenance | actively maintained — 709 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,882,604/month — #2,208 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_model_utils-5.0.0-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
django-dirtyfieldsTracks which fields on a Django model instance…
permissive · top 15,000 on PyPI
django-upgradeAutomatically modernizes Django project code by…
permissive · top 15,000 on PyPI
django-contrib-commentsProvides a Django framework for attaching…
permissive · top 15,000 on PyPI
django-soft-deleteAdds soft deletion to Django models by marking…
permissive · top 15,000 on PyPI
swapperSwapper provides an API for Django's…
permissive · top 15,000 on PyPI
sqlalchemy-mixinsProvides Active Record-style mixins for…
permissive · top 15,000 on PyPI
django-picklingSpeeds up Django model pickling by 2-3 times…
permissive · top 15,000 on PyPI
django-safedeleteProvides soft-delete functionality for Django…
permissive · top 5,000 on PyPI
django-bracesProvides reusable mixin classes for Django…
permissive · top 15,000 on PyPI
django-sql-utilsProvides simplified APIs for Django querysets…
permissive · top 15,000 on PyPI