示例#1
0
def initialize_extensions(app):
    """Helper functions"""
    api.init_app(app)
    db.init_app(app)
    mail.init_app(app)
    migrate.init_app(app, db, directory='migrations')
    jwt.init_app(app)
示例#2
0
def initialize_extensions(app):
    """Helper functions"""
    api.init_app(app)
    db.init_app(app)
    jwt.init_app(app)
    mail.init_app(app)
    migrate.init_app(app, db, directory="migrations")

    @jwt.token_in_blacklist_loader
    def check_if_token_in_blacklist(decrypted_token):
        """Checking if token is blacklisted"""
        jti = decrypted_token["jti"]
        return JWTToken.is_jti_blacklisted(jti)
示例#3
0
def register_api(app):
    """Register restful api. 可以在这里导入api或者直接在api文件里用api.route"""
    api.init_app(app)
    db.init_app(app)