I created a blueprint with a route and registered the blueprint with my Flask app. However, I get a 404 when requesting the route. What is wrong with my code?
You registered the blueprint before the code that registered the route executed. Move register_blueprint after the blueprint has been fully defined.
register_blueprint
bp = Blueprint('test', __name__, url_prefix='/test') @bp.route('/') def home(): return 'Hello, World!' app.register_blueprint(bp)