Default login_required rather than adding decorator everywhere
问题 I'm using Flask-HTTPAuth to handle authentication in my app. I have a lot of views, and I don't want to add login_required to every one of them. How can I make login required by default? from flask.ext.httpauth import HTTPBasicAuth auth = HTTPBasicAuth() @auth.verify_password def verify_password(username, password): return username == '111' and password == '222' @app.route('/') @app.route('/home/') @auth.login_required def index(): return 'Hello' @app.route('/route2/') def route2(): return