emmmmm。问题是,我有三个蓝图并在那里使用蓝图,例如' www' admin'移动'移动'并使用url_prefix注册到app是默认" /"
app.register_blueprint(admin_blueprint)
app.register_blueprint(mobile_blueprint)
app.register_blueprint(front_blueprint)
当font_blueprint绑定app_errorhandler(404)时。
烧瓶文件:
app_errorhandler(代码):
与Flask.errorhandler()类似,但是对于蓝图。此处理程序用于所有请求,即使蓝图的外部。
蓝图之外。,那么如何将error_page与单一蓝图绑定
帮助我答案 0 :(得分:0)
你可以register a error handler to a blueprint。
admin_blueprint = Blueprint("admin", __name__)
admin_blueprint.error_handler(404)
def page_not_found(e):
pass