Connecting Receivers Properly
Register signals in apps.py to avoid pitfalls.
Receivers Must Be Imported
A receiver only listens if Django actually imports the module it lives in. If the file is never loaded, the signal silently does nothing.
The Classic Trap
Putting receivers in models.py sometimes works by luck, and sometimes not. That fragility is the connection problem you want to avoid.
All lessons in this course
- post_save and pre_delete Signals
- Connecting Receivers Properly
- Writing Custom Middleware
- Middleware Order and process_view