views:

211

answers:

2

Is there a way to see which signals have been set in Django?

+4  A: 

Theres a django app called django-debug-toolbar which adds a little toolbar at the top of all django served pages which has all sorts of info relating to backend of the page's rendering, such as how many queries were executed, how much time they each took, etc. It also prints out signals. I don't use signals in my app, so I have never used that feature, but it's there.

nbv4
+3  A: 

It's not really exposed in docs but Signal is just a class that contains a list of receivers which are called on event. You can manually check this list:

from django.db.models.signals import *

for signal in [pre_save, pre_init, pre_delete, post_save, post_delete, post_init, post_syncdb]:
    # print a List of connected listeners
    print signal.receivers
kibitzer