django-dirtyfields
Tracking dirty fields on a Django model instance.
Decision gist · record as of 2026-08-14
Yes. The package is production-stable, actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a common Django pattern cleanly. Use it when you need to detect in-memory changes to model instances without extra database queries.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only Django as a runtime dependency.
- Actively maintained with recent commits and compatible across Django 3.2 through 6.0 and Python 3.10–3.14.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial and private use with minimal restrictions beyond attribution and liability disclaimers.
last release 2026-01-22 (204 days) · last repo commit 2026-07-30 · 653 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 670,955 downloads/mo, #5,406 on PyPI
Alternatives
Verify before relying
pip install django-dirtyfields
from django.db import models
from dirtyfields import DirtyFieldsMixin
class ExampleModel(DirtyFieldsMixin, models.Model):
boolean = models.BooleanField(default=True)
model = ExampleModel.objects.create(boolean=True)
model.boolean = False
model.is_dirty() # True
model.get_dirty_fields() # {'boolean': True}What it is and what it does
Django Dirty Fields is a mixin that tracks in-memory changes to Django model instances, letting you detect which fields differ from their database values without querying the database. You inherit from DirtyFieldsMixin on any model, then call is_dirty() to check if the instance has unsaved changes or get_dirty_fields() to retrieve a dictionary of changed field names and their original values.
This is useful for conditional logic around saves, audit trails, or avoiding unnecessary database writes. The package has been in production use since its early releases and is tested against a wide range of Django and Python versions. It requires only Django as a dependency and installs as a lightweight pure-Python wheel.
Use it for
- Check if a model instance has unsaved changes before deciding whether to call save().
- Audit which fields were modified on an instance for logging or change-tracking systems.
- Conditionally trigger side effects only when specific fields change.
- Implement undo/rollback logic by comparing dirty fields to their original database values.
- Validate that certain fields have not been modified before allowing a save operation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is production-stable, actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a common Django pattern cleanly. Use it when you need to detect in-memory changes to model instances without extra database queries.
Install
django-dirtyfields on PyPI
Before you install
Low friction: pure Python wheel with only Django as a runtime dependency. Actively maintained with recent commits and compatible across Django 3.2 through 6.0 and Python 3.10–3.14.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
pip install django-dirtyfields
from django.db import models
from dirtyfields import DirtyFieldsMixin
class ExampleModel(DirtyFieldsMixin, models.Model):
boolean = models.BooleanField(default=True)
model = ExampleModel.objects.create(boolean=True)
model.boolean = False
model.is_dirty() # True
model.get_dirty_fields() # {'boolean': True}
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageDjango |
| Maintenance | Actively maintained 204 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 670,955 / month, #5,406 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python Modules |
Evidence: django_dirtyfields-1.9.9-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “detect modified fields django”
- django-dirtyfieldsTracks which fields on a Django model instance have been modified in…
- django-model-utilsProvides reusable model mixins and field utilities for Django…
- django-easy-auditLogs every CRUD operation, authentication event, and HTTP request in…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also django-auditlog · django-lifecycle · django-model-utils · django-perf-rec · django-test-plus · django-read-only · django-concurrency · django-pghistory · django-picklefield · django-fsm-log