Is there a way to see which signals have been set in Django?
If you want to list only the connected receivers for a specific signal on a specific model, you can look at _live_receivers
. For instance, if you want to list the connected post_save hooks for a model named MyModel, you can do:
from django.db.models.signals import post_save
from models import MyModel
print(post_save._live_receivers(MyModel))
I found this approach in the Django source code by looking for how has_listeners
works: https://github.com/django/django/blob/3eb679a86956d9eedf24492f0002de002f7180f5/django/dispatch/dispatcher.py#L153