Recall & Review
beginner
What is a template engine in Flask?
A template engine in Flask is a tool that helps create HTML pages by combining static HTML with dynamic data from Python code. It makes web pages flexible and easy to update.
Click to reveal answer
beginner
Why do we use template engines instead of writing plain HTML in Flask?
Template engines let us insert dynamic content easily, reuse page parts, and keep code organized. Writing plain HTML would mean repeating code and mixing logic with design.Click to reveal answer
intermediate
How does a template engine improve code maintenance?
It separates the design (HTML) from the logic (Python), so changes in one don’t break the other. This separation makes it easier to update and fix parts without confusion.
Click to reveal answer
beginner
What is Jinja2 in Flask?
Jinja2 is the default template engine used by Flask. It allows you to write HTML with special tags to add variables, loops, and conditions, making pages dynamic.
Click to reveal answer
intermediate
How do template engines help with security in Flask apps?
They automatically escape dangerous characters in user data to prevent attacks like cross-site scripting (XSS), keeping the app safer without extra work.
Click to reveal answer
What is the main purpose of a template engine in Flask?
✗ Incorrect
Template engines combine HTML with dynamic data, making web pages flexible and dynamic.
Which template engine does Flask use by default?
✗ Incorrect
Flask uses Jinja2 as its default template engine.
How do template engines help keep code organized?
✗ Incorrect
Template engines separate design (HTML) from logic (Python), improving organization.
What security benefit do template engines provide automatically?
✗ Incorrect
Template engines escape dangerous characters to prevent cross-site scripting (XSS) attacks.
Why is reusing parts of a web page easier with template engines?
✗ Incorrect
Template engines let you write reusable parts like headers or footers once and include them in many pages.
Explain in your own words why template engines matter in Flask web development.
Think about how web pages change and how code stays clean.
You got /5 concepts.
Describe how Jinja2 helps create dynamic web pages in Flask.
Focus on how Jinja2 mixes Python data with HTML.
You got /4 concepts.