skillfed

django-model-utils

Django model mixins and utilities

django-model-utils v5.0.0 4.9M downloads/30d#2,208 on PyPI2,762
Permissive license BSD Active released

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

uv

uv add django-model-utils

poetry

poetry add django-model-utils

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

django model mixinsfield tracking djangosoft delete modelsdjango utilitiesstatus field djangomodel inheritance djangotimestamped models
django-ormmodel-utilitiessoft-delete

More Application Frameworks packages