The observer/observable pattern lets one component register interest in an action and receive notification when that action occurs. Django signals apply this model to ORM events, so related work can happen automatically without repeating checks throughout application code. section 6.5
Django model signals provide a practical observer workflow:
- Choose an event such as post_save and register a handler with the receiver decorator. section 6.5
- Connect the signal to a sender, such as the User model, whose actions matter. section 6.5
Creating a user profile automatically
A post_save handler checks created and raw, retrieves the new User instance, verifies that no UserProfile already exists, and creates one when needed. This covers users created in application code, the Django Admin, or fixture loading. section 6.5



