python – Flask:如何在蓝图中的每个路径之前运行方法?

python – Flask:如何在蓝图中的每个路径之前运行方法?

我想让Flask Blueprint在执行任何路由之前始终运行一个方法.我没有用自定义装饰器装饰我的蓝图中的每个路线方法,而是希望能够做到这样的事情: def my_method(): do_stuffsection = Blueprint(section, __name__)# Register my_method() as a setup method th