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 named order_completed.
order_completed = [1]()To create a custom signal, instantiate the Signal class.
Fix the error in the receiver function decorator to connect it to the order_completed signal.
@[1](order_completed) def notify_user(sender, **kwargs): print('Order completed!')
The @receiver decorator connects the function to the signal.
Fill both blanks to send the order_completed signal with the sender as the Order class.
order_completed.[1](sender=[2])
Use the send method on the signal to notify receivers, specifying the sender.
Fill all three blanks to define a receiver function that listens to order_completed and prints the order ID from kwargs.
@[1](order_completed) def handle_order(sender, **[2]): print(f"Order ID: [3]['order_id']")
The receiver decorator connects the function to the signal. The function uses **kwargs to access extra data, here printing the 'order_id'.