django-safedelete
Mask your objects instead of deleting them from your database.
Decision gist · record as of 2026-08-14
Yes, with conditions. The package is well-established (in top 5000 PyPI by downloads), has no known vulnerabilities, and low install friction. However, the aging maintenance status (527 days since last release) and lack of explicit Python 3.12+ / Django 5.1+ support in the fact sheet warrant verification before adopting in new projects targeting the latest Django versions. Suitable for existing Django applications needing soft-delete without major framework upgrades.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django as a runtime dependency; ensure Django version compatibility with the branch you install (1.4.x supports Django 3.2+, 4.0+, 4.1+, 4.2+).
- Low install friction with only Django and packaging as runtime dependencies.
- Maintenance status is aging—last release was 527 days ago (2025-03-05), though the repository remains active with recent commits and no archived status.
License · maintenance · safety
BSD (permissive) — BSD license (permissive) imposes no significant restrictions on use or redistribution.
last release 2025-03-05 (527 days) · last repo commit 2025-03-10 · 707 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,206,242 downloads/mo, #4,221 on PyPI
Alternatives
Verify before relying
pip install django-safedelete
# In settings.py, add 'safedelete' to INSTALLED_APPS
from safedelete.models import SafeDeleteModel, SOFT_DELETE
from django.db import models
class Article(SafeDeleteModel):
_safedelete_policy = SOFT_DELETE
title = models.CharField(max_length=100)
article = Article.objects.create(title='Test')
article.delete() # Masked, not removed
Article.objects.filter(title='Test').exists() # False (hidden by default)
Article.all_objects.filter(title='Test').exists() # True (includes soft-deleted)- Whether current version supports Django 5.0+ and Python 3.12+ despite changelog noting 1.4.0 added Django 5.0 support
- Specific behavior differences between the five deletion policies (SOFT_DELETE, SOFT_DELETE_CASCADE, HARD_DELETE, HARD_DELETE_NOCASCADE, NO_DELETE) in edge cases
- Performance impact on large datasets with many soft-deleted records
What it is and what it does
django-safedelete is a Django application that intercepts model deletion to implement soft-delete behavior—marking objects as deleted in the database without physically removing them. Instead of calling DELETE on the database, it masks records so they remain retrievable for audit, recovery, or compliance purposes while being hidden from normal queries.
You define a deletion policy per model by setting the _safedelete_policy attribute. The package provides five policies: SOFT_DELETE (default, masks the object), SOFT_DELETE_CASCADE (masks the object and dependent models), HARD_DELETE (normal deletion), HARD_DELETE_NOCASCADE (hard-deletes only if no other objects reference it, otherwise soft-deletes), and NO_DELETE (prevents deletion entirely). Models inherit from SafeDeleteModel, and the package handles query filtering, admin integration, and restoration automatically.
Use it for
- Audit trails: retain deleted records for compliance or historical review without exposing them in normal application queries
- Data recovery: restore accidentally deleted objects without database backups or manual intervention
- Referential integrity: soft-delete dependent objects while preserving foreign-key relationships for reporting
- Multi-tenant systems: hide deleted tenant data from queries while keeping it available for account recovery or legal holds
- Admin interfaces: provide undo/restore functionality in Django admin for recently deleted records
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
The package is well-established (in top 5000 PyPI by downloads), has no known vulnerabilities, and low install friction. However, the aging maintenance status (527 days since last release) and lack of explicit Python 3.12+ / Django 5.1+ support in the fact sheet warrant verification before adopting in new projects targeting the latest Django versions. Suitable for existing Django applications needing soft-delete without major framework upgrades.
Install
django-safedelete on PyPI
Before you install
Low install friction with only Django and packaging as runtime dependencies. Maintenance status is aging—last release was 527 days ago (2025-03-05), though the repository remains active with recent commits and no archived status.
Requires Django as a runtime dependency; ensure Django version compatibility with the branch you install (1.4.x supports Django 3.2+, 4.0+, 4.1+, 4.2+).
License in practice
BSD license (permissive) imposes no significant restrictions on use or redistribution.
Quickstart
pip install django-safedelete
# In settings.py, add 'safedelete' to INSTALLED_APPS
from safedelete.models import SafeDeleteModel, SOFT_DELETE
from django.db import models
class Article(SafeDeleteModel):
_safedelete_policy = SOFT_DELETE
title = models.CharField(max_length=100)
article = Article.objects.create(title='Test')
article.delete() # Masked, not removed
Article.objects.filter(title='Test').exists() # False (hidden by default)
Article.all_objects.filter(title='Test').exists() # True (includes soft-deleted)
Verify before relying
- Whether current version supports Django 5.0+ and Python 3.12+ despite changelog noting 1.4.0 added Django 5.0 support
- Specific behavior differences between the five deletion policies (SOFT_DELETE, SOFT_DELETE_CASCADE, HARD_DELETE, HARD_DELETE_NOCASCADE, NO_DELETE) in edge cases
- Performance impact on large datasets with many soft-deleted records
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesDjangopackaging |
| Maintenance | Aging 527 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,206,242 / month, #4,221 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8 |
Evidence: django_safedelete-1.4.1-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 › “django safedelete”
- django-safedeleteProvides soft-delete functionality for Django models, allowing…
- django-upgradeAutomatically modernizes Django project code by applying syntax and…
- django-nineProvides version checking utilities for Django, allowing code to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also django-soft-delete · sqlalchemy-easy-softdelete · django-cryptography-5 · django-reversion · django-model-utils · django-crum · django-sortedm2m · django-cryptography · django-cryptography-django5