In Django, what does it mean to generate an action in a separate signal?
For example, is this documentation here: https://github.com/brantyoung/django-notifications
It states: Generating notifications is probably best done in a separate signal.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the documentation you mentioned, there are two signals used by the example. The first one is
notifications.notifyand the other one isdjango.db.models.signals.post_save.In order to use the notification app, basically you only need the first signal. For example, anywhere in your code you can write:
However, the writer suggest that you should emit the notify signal after (or when) you handle another signal. Hence the example below:
That is, you send the notify signal as a part of the post_save signal handler.