我有一个应用程序,它很大,所以它分为模块和使用blueprints,add_url_rule用于路由到各个模块。一切正常,并按预期进行。
问题是,我需要使用文档中的 Flask-Login ( https://flask-login.readthedocs.org/en/latest/#api-documentation )。我只能找到如何使用 保护视图decorators,应用程序应该使用app.route('/home'). 但就像我已经提到的那样,我正在使用blueprintsand add_url_rule。
编辑:@Mark Hildreth 编辑到这个问题的答案是所需的解决方案。谢谢你。