Complete the code to import Flask and create an app instance.
from flask import [1] app = [1](__name__)
You import the Flask class from the flask package and create an app instance by calling Flask(__name__).
Complete the code to define a route for the home page.
@app.[1]('/') def home(): return 'Hello, Flask!'
The @app.route decorator defines the URL route for the function below it.
Fix the error in the app run command to enable debug mode.
if __name__ == '__main__': app.run(debug=[1])
The debug parameter expects a boolean value True without quotes.
Fill both blanks to create a dictionary comprehension mapping endpoints to their view function names.
routes = {endpoint: func[1] for endpoint, func in app.[2].items()}app.view_functions is a dictionary mapping endpoint names (which correspond to URL rules) to view functions. Iterate with .items() and use func.__name__ for the function name.
Fill all three blanks to create a Flask blueprint and register it.
from flask import Blueprint bp = Blueprint('[1]', __name__, url_prefix='[2]') app.[3](bp)
Blueprints are created with a name like 'auth' and a URL prefix like '/auth'. They are registered on the app with app.register_blueprint(bp).