Recall & Review
beginner
What is the purpose of the
app.py file in a Flask project?The
app.py file is the main entry point of a Flask application. It creates the Flask app instance and defines routes and configurations.Click to reveal answer
beginner
Why do Flask projects often have a
templates folder?The
templates folder stores HTML files that Flask uses to render web pages dynamically using the Jinja2 template engine.Click to reveal answer
beginner
What is the role of the
static folder in a Flask project?The
static folder holds static files like CSS, JavaScript, and images that the browser can load directly without processing.Click to reveal answer
intermediate
Why might a Flask project use a
config.py file?A
config.py file stores configuration settings like secret keys, database URLs, and debug mode, keeping them separate from the main code.Click to reveal answer
intermediate
What is the benefit of organizing Flask code into a package (a folder with
__init__.py) instead of a single file?Using a package allows splitting code into modules for routes, models, and helpers. This keeps the project clean, easier to maintain, and scalable.
Click to reveal answer
Which folder in a Flask project contains HTML templates?
✗ Incorrect
The
templates folder holds HTML files used by Flask to render pages.Where should you put CSS and JavaScript files in a Flask project?
✗ Incorrect
Static files like CSS and JavaScript go into the
static folder.What is the main purpose of
app.py in Flask?✗ Incorrect
app.py is where you create the Flask app and define routes.Why use a
config.py file in a Flask project?✗ Incorrect
config.py keeps settings like secret keys and database URLs organized.What does adding an
__init__.py file to a folder do in a Flask project?✗ Incorrect
An
__init__.py file makes the folder a Python package, allowing modular code.Describe the typical folder structure of a Flask project and the purpose of each main folder or file.
Think about where you put your HTML, styles, and main code.
You got /5 concepts.
Explain why organizing Flask code into packages and separate files is helpful as a project grows.
Compare a messy desk to a tidy one with labeled drawers.
You got /4 concepts.