Skip to main content

django-delete-guard (DeleteGuard)

Blocks dangerous Django ORM deletes in production — before they happen.

Backups and alerts are too late.
This stops risky QuerySet.delete() calls at execution time, unless the developer explicitly opts in.


Why this exists

If you’ve ever:

  • wiped production with a bad .delete()
  • underestimated cascade deletes
  • run a “quick cleanup” script in prod
  • trusted migrations too much

…this is for you.

Most catastrophic data loss is valid code with invalid intent.
Django makes bulk deletes deceptively easy. This guard makes them explicit.


What it does (V1)

In production only (APP_ENV=production|prod), it blocks:

  • ❌ Unfiltered deletes
    Model.objects.all().delete()

  • ❌ Bulk deletes over 100 rows

Unless you explicitly override with intent.

Everything else works normally.


Install (60 seconds)

pip install django-delete-guard

Metadata

Release files for django-delete-guard 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-delete-guard 0.1.1
File Size Uploaded Provenance
django_delete_guard-0.1.1.tar.gz 5.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-delete-guard 0.1.1
File Interpreter ABI Platform
django_delete_guard-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / django_delete_guard-0.1.1.tar.gz

Download URL django_delete_guard-0.1.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
66644e62d7dcaff2a27681c9a7bfacc3f5b7ea8e537a678aab6f4dde28084359
BLAKE2b-256 checksum
How to use checksums
3a78dd724ba8f72a566e12b84d226168da7e4726ab9a4811e6025addda921007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / django_delete_guard-0.1.1-py3-none-any.whl

Download URL django_delete_guard-0.1.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ff6c7d9509128d9f986eae4af5a4b47d63999761c496b3bf734abc7aafd027f
BLAKE2b-256 checksum
How to use checksums
e4d52a517fd08b150f401361241b8cd3b85266dd0b22d2043ecdf8ffc502a86b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for django-delete-guard 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page