Complete the code to import the Django signal dispatcher.
from django.dispatch import [1]
The Signal class is imported from django.dispatch to create custom signals.
Complete the code to define a new custom signal.
my_signal = [1]()To define a new signal, you create an instance of the Signal class.
Fix the error in connecting a receiver function to a signal.
@receiver([1]) def my_handler(sender, **kwargs): print('Signal received')
The @receiver decorator needs the signal instance to connect the handler properly.
Fill both blanks to send a signal with a sender and extra data.
my_signal.[1](sender=[2], data='hello')
Use the send method on the signal instance, specifying the sender class.
Fill all three blanks to create a decoupled receiver function for a signal.
from django.dispatch import [1] @[2](my_signal) def handle_signal(sender, **[3]): print('Handled decoupled signal')
Import the receiver decorator, use it to decorate the handler, and accept kwargs for extra data.
