Recall & Review
beginner
What is a custom signal in Django?
A custom signal is a way to send notifications within your Django app when certain actions happen. It lets different parts of your app talk to each other without being tightly connected.
Click to reveal answer
beginner
How do you create a custom signal in Django?
You create a custom signal by importing Signal from django.dispatch and then defining a new Signal instance, like
my_signal = Signal().Click to reveal answer
beginner
What is the role of a receiver function in Django signals?
A receiver function listens for a signal and runs some code when that signal is sent. It connects to the signal using the
@receiver decorator or the connect() method.Click to reveal answer
beginner
How do you send a custom signal in Django?
You send a custom signal by calling its
send() method, usually passing the sender and any extra data as keyword arguments.Click to reveal answer
intermediate
Why use custom signals instead of calling functions directly?
Custom signals help keep your code loosely connected. This means parts of your app can work independently and be easier to maintain or change later.
Click to reveal answer
Which Django module do you import to create a custom signal?
✗ Incorrect
Custom signals are created using the Signal class from django.dispatch.
What decorator is commonly used to connect a receiver function to a signal?
✗ Incorrect
The @receiver decorator from django.dispatch is used to connect functions to signals.
What method do you call to send a custom signal?
✗ Incorrect
You use the send() method on the Signal instance to send a signal.
Which argument is usually passed as the sender when sending a signal?
✗ Incorrect
The sender argument identifies who is sending the signal, often a class or object.
What is a key benefit of using custom signals in Django?
✗ Incorrect
Custom signals help different parts of your app communicate without being tightly connected.
Explain how to create, connect, and send a custom signal in Django.
Think about the steps from defining the signal to making it work.
You got /5 concepts.
Describe why using custom signals can improve your Django app's design.
Consider how signals affect code connections.
You got /4 concepts.