django-signal-guard: catch bulk writes that silently skip your pre_save / post_save receivers

bulk_create(), bulk_update() and QuerySet.update() don’t call Model.save(), so pre_save and post_save receivers never run. Nothing errors: the search index, audit log or cache just quietly drifts, and you find out in production.

django-signal-guard makes that loud in development, tests and CI:

SignalBypassError: QuerySet.bulk_create() on shop.Order skips 2 receivers:
  pre_save   shop.signals.normalize_status  (shop/signals.py:5)
  post_save  shop.signals.reindex_order  (shop/signals.py:9)
Called from shop/imports.py:42.

It also catches:

  • emails, Celery tasks and HTTP calls made in a receiver before the transaction commits (the classic DoesNotExist in the worker), with @receiver_on_commit as the fix
  • receivers that save their own instance and loop, with the whole chain
  • receivers that never get connected, or run twice (system checks)
  • new receivers, through a signals.lock file checked in CI, so they show up in code review

It doesn’t add new signals or replace them with hooks. Like nplusone does for lazy queries, it only reports misuse. It warns by default; set "raise" in your test settings to fail tests. On an existing codebase, a pytest baseline keeps known reports quiet and fails CI only on new ones.

pip install django-signal-guard (Python 3.10+, Django 5.2+)