Exemple #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)
Exemple #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)
Exemple #3
0
def register_extensions(app):
    db.init_app(app)
    migrate.init_app(app, db)
    mail.init_app(app)
    avatars.init_app(app)
    limiter.init_app(app)
Exemple #4
0
def register_extensions(app):
    mail.init_app(app)
    cors.init_app(app)
    return None