Recall & Review
beginner
What is a Flask Blueprint?
A Flask Blueprint is a way to organize a group of related routes, templates, and static files into a reusable module. It helps keep the app structure clean and modular.
Click to reveal answer
beginner
Why should you use Blueprints in a Flask app?
Using Blueprints helps split your app into smaller parts, making it easier to manage, test, and reuse code. It also allows multiple developers to work on different parts without conflicts.
Click to reveal answer
beginner
How do you register a Blueprint in a Flask app?
You create a Blueprint object, define routes on it, then register it on the main Flask app using app.register_blueprint(your_blueprint).
Click to reveal answer
beginner
What is a good practice for naming Blueprints?
Use clear, descriptive names that reflect the feature or module, like 'auth' for authentication or 'blog' for blog posts. This helps keep code understandable.
Click to reveal answer
intermediate
How can Blueprints improve testing in Flask?
Blueprints isolate parts of the app, so you can test each module separately. This makes tests simpler and faster to write and run.
Click to reveal answer
What is the main purpose of a Flask Blueprint?
✗ Incorrect
Blueprints help organize routes and related code into modules for better structure.
How do you add a Blueprint to your Flask app?
✗ Incorrect
You register a Blueprint on the main app using app.register_blueprint().
Which of these is a good Blueprint name for user login features?
✗ Incorrect
'auth' clearly describes authentication-related routes.
What is a benefit of using Blueprints for testing?
✗ Incorrect
Blueprints isolate app parts, making it easier to test modules independently.
Which statement about Blueprints is FALSE?
✗ Incorrect
Blueprints do not replace the main app; they are registered on it.
Explain how Blueprints help organize a Flask application and why this is useful.
Think about how breaking a big task into smaller parts helps.
You got /4 concepts.
Describe the steps to create and register a Blueprint in a Flask app.
Focus on the order from creation to registration.
You got /3 concepts.