The Django framework includes the concept of signals, which are similar to events in JavaScript. There are a handful of built-in signals. You can use them to trigger actions before and after the initialization of a model, saving or deleting an instance, migrating the database schema, handling a request, and so on. Moreover, you can create your own signals in your reusable apps and handle them in other apps. In this recipe, you will learn how to use signals to send emails to administrators whenever a specific model is saved.
Using signals to notify administrators about new entries
Getting ready
Let's start with the viral_videos app that we created in the Using database query expressions recipe.