Complete the code to create a Flask Blueprint named 'admin'.
from flask import Blueprint admin_bp = Blueprint('[1]', __name__)
The Blueprint name 'admin' is used to create a namespace for admin routes.
Complete the code to register the 'admin' Blueprint with the Flask app under the URL prefix '/admin'.
from flask import Flask app = Flask(__name__) app.register_blueprint(admin_bp, url_prefix='[1]')
The URL prefix '/admin' ensures all routes in the admin Blueprint start with '/admin'.
Fix the error in the route decorator to use the 'admin' Blueprint instead of the Flask app.
@[1].route('/dashboard') def dashboard(): return 'Admin Dashboard'
The route decorator must be called on the Blueprint object 'admin_bp' to register the route under that namespace.
Fill both blanks to create a Blueprint named 'api' and register it with the app under '/api'.
api_bp = Blueprint('[1]', __name__) app.register_blueprint([2], url_prefix='/api')
The Blueprint is named 'api' and the variable 'api_bp' is registered with the app.
Fill all three blanks to define a route '/status' in the 'api' Blueprint that returns JSON with a status message.
from flask import jsonify @[1].route('[2]') def status(): return jsonify({{'status': '[3]'}})
The route is defined on 'api_bp' with path '/status' and returns JSON with status 'ok'.