Are Django signals asynchronous by default? What are the risks of performing heavy processing like sending an email inside a post_save signal?
Last updated
No. Signals are synchronous: receivers run in the same thread and transaction, so
.save()doesn't return until they all finish.Emailing in
post_saveadds SMTP latency to the request and can raise errors inside the save. It also fires before commit, so you may email about data that rolls back.Enqueue the work to a task queue (Celery, RQ) and defer it with
transaction.on_commit().