Пример #1
0
def configure_extensions(app):
    """
    Attaches and configures any needed flask extensions
    to our app.

    :param app:
    """
    db.init_app(app)
    migrate.init_app(app, db)
    principal.init_app(app)
    smtp_mail.init_app(app)
    metrics.init_app(app)
    sentry.init_app(app)
Пример #2
0
def configure_extensions(app):
    """
    Attaches and configures any needed flask extensions
    to our app.

    :param app:
    """
    db.init_app(app)
    migrate.init_app(app, db)
    principal.init_app(app)
    smtp_mail.init_app(app)
    metrics.init_app(app)
    sentry.init_app(app)
Пример #3
0
def configure_extensions(app):
    """
    Attaches and configures any needed flask extensions
    to our app.

    :param app:
    """
    db.init_app(app)
    migrate.init_app(app, db)
    principal.init_app(app)
    smtp_mail.init_app(app)
    metrics.init_app(app)
    sentry.init_app(app)

    if app.config['CORS']:
        app.config['CORS_HEADERS'] = 'Content-Type'
        cors.init_app(app, resources=r'/api/*', headers='Content-Type', origin='*', supports_credentials=True)
Пример #4
0
def configure_extensions(app):
    """
    Attaches and configures any needed flask extensions
    to our app.

    :param app:
    """
    db.init_app(app)
    migrate.init_app(app, db)
    principal.init_app(app)
    smtp_mail.init_app(app)
    metrics.init_app(app)
    sentry.init_app(app)

    if app.config['CORS']:
        app.config['CORS_HEADERS'] = 'Content-Type'
        cors.init_app(app, resources=r'/api/*', headers='Content-Type', origin='*', supports_credentials=True)
Пример #5
0
def configure_extensions(app):
    """
    Attaches and configures any needed flask extensions
    to our app.

    :param app:
    """
    db.init_app(app)
    migrate.init_app(app, db)
    principal.init_app(app)
    smtp_mail.init_app(app)
    metrics.init_app(app)
    sentry.init_app(app)

    if app.config["CORS"]:
        app.config["CORS_HEADERS"] = "Content-Type"
        cors.init_app(
            app,
            resources=r"/api/*",
            headers="Content-Type",
            origin="*",
            supports_credentials=True,
        )