5.6.0
New method added to register ImpBlueprints: imp.register_imp_blueprint
from flask import Flask
from flask_imp import Imp
imp = Imp()
DO_IMPORT = True
def create_app():
app = Flask(__name__)
imp.init_app(app)
if DO_IMPORT:
from app.my_blueprint import bp
imp.register_imp_blueprint(bp)
return appAddition of two new decorators @checkpoint and @api_checkpoint these will eventually replace login_check, api_login_check and permission_check
The intention is the it's part of the security package, and they are security.checkpoint - s of which you can have multiple.
@bp.route("/admin", methods=["GET"])
@checkpoint(
'logged_in',
True,
fail_endpoint='blueprint.login_page',
message="Login needed"
)
@checkpoint(
'user_type',
'admin',
fail_endpoint='blueprint.index',
message="You need to be an admin to access this page"
)
def admin_page():
...