Recall & Review
beginner
What do double braces {{ }} mean in Django templates?
Double braces {{ }} are used to display the value of a variable passed from the Django view to the template.
Click to reveal answer
beginner
How do you show a variable named 'username' in a Django template?
Use {{ username }} inside the template to display the value of the 'username' variable.
Click to reveal answer
intermediate
Can you use expressions inside {{ }} in Django templates?
No, Django templates only allow simple variable names or filters inside {{ }}. Complex expressions are not supported.
Click to reveal answer
beginner
What happens if a variable inside {{ }} does not exist in the context?
Django will render an empty string if the variable is missing, so nothing will show up in the output.
Click to reveal answer
intermediate
How can you modify a variable's output inside {{ }}?
You can use filters like {{ variable|lower }} to change the output, for example making text lowercase.
Click to reveal answer
What does {{ user.email }} do in a Django template?
✗ Incorrect
Double braces {{ }} display the value of variables or their attributes passed from the view.
If a variable inside {{ }} is missing, what will Django show?
✗ Incorrect
Django silently renders an empty string if the variable is not found in the context.
Which of these is valid inside {{ }} in Django templates?
✗ Incorrect
Filters like |upper can be used inside {{ }}, but function calls or control flow are not allowed.
How do you safely display a variable that might contain HTML in Django templates?
✗ Incorrect
The |safe filter tells Django not to escape HTML, so it renders as HTML.
What is the purpose of using {{ }} in Django templates?
✗ Incorrect
Double braces {{ }} are used to output variables passed from the view to the template.
Explain how Django template variables with double braces {{ }} work and how they connect to the view.
Think about how data moves from Python code to the HTML page.
You got /4 concepts.
Describe how you can modify the output of a variable inside {{ }} using filters in Django templates.
Filters are like little helpers that change how the variable looks.
You got /4 concepts.