Complete the code to create a Flask blueprint named 'auth'.
from flask import Blueprint auth = Blueprint('[1]', __name__)
The first argument to Blueprint is the blueprint's name. Here, it should be 'auth' to match the variable name.
Complete the code to register the 'auth' blueprint with the Flask app.
from flask import Flask app = Flask(__name__) app.[1](auth)
To add a blueprint to a Flask app, use the register_blueprint method.
Fix the error in the blueprint route decorator to use the correct blueprint name.
from flask import Blueprint auth = Blueprint('auth', __name__) @[1].route('/login') def login(): return 'Login Page'
The route decorator must be called on the blueprint object, which is named 'auth' here.
Fill both blanks to create and register a blueprint named 'blog' with the Flask app.
from flask import Flask, Blueprint app = Flask(__name__) blog = Blueprint('[1]', __name__) app.[2](blog)
The blueprint name is 'blog' and the method to register it is register_blueprint.
Fill all three blanks to define a blueprint named 'shop', add a route '/items', and register it with the app.
from flask import Flask, Blueprint app = Flask(__name__) shop = Blueprint('[1]', __name__) @shop.route('[2]') def items(): return 'Shop Items' app.[3](shop)
The blueprint is named 'shop', the route is '/items', and the blueprint is registered with register_blueprint.