[Answer]-Receiving duplicate signals. How to search for the cause?

1👍

Move it out of your __init__.py and save it either signals.py (a new file that is in your app directory, the same place as views.py) or in your models.py, which is recommended in the documentation:

You can put signal handling and registration code anywhere you like.
However, you’ll need to make sure that the module it’s in gets
imported early on so that the signal handling gets registered before
any signals need to be sent. This makes your app’s models.py a good
place to put registration of signal handlers.

The __init__.py is a very bad place to put code like this, because there is a very good chance it will be executed more than once.

Leave a comment