예제 #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 configure_extensions(app, cli):
    """configure flask extensions
    """
    db.init_app(app)
    jwt.init_app(app)

    if cli is True:
        migrate.init_app(app, db)
예제 #3
0
def register_extensions(app):
    """Register Flask extensions."""

    # Register database and models
    with app.app_context():
        db.init_app(app)
        migrate.init_app(app, db)

    # Register JWT helper
    jwt.init_app(app)
예제 #4
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)
예제 #5
0
def register_extensions(app: Flask):
    """Register Flask extensions."""

    # Register database and models
    with app.app_context():
        db.init_app(app)
        migrate.init_app(app, db)

    # Register JWT token auth
    jwt.init_app(app)

    # Registering application encryption
    bcrypt.init_app(app)