Example #1
0
def configure_extensions(app, admin):
    babel.configure(app)
    generic.configure(app)
    Cache(app)
    Mail(app)
    Dealer(app)
    error_handlers.configure(app)
    db.init_app(app)
    fixtures.configure(app)
    themes.configure(app, db)  # Themes should be configured after db

    context_processors.configure(app)
    template_filters.configure(app)

    user_datastore = MongoEngineUserDatastore(db, User, Role)
    Security(app, user_datastore)

    blueprints.load_from_packages(app)
    blueprints.load_from_folder(app)

    configure_admin(app, admin)

    if app.config.get('DEBUG_TOOLBAR_ENABLED'):
        try:
            from flask_debugtoolbar import DebugToolbarExtension
            DebugToolbarExtension(app)
        except:
            pass

    before_request.configure(app)
    views.configure(app)

    return app
Example #2
0
def configure_extensions(app, admin):
    logger.configure(app)
    cache.init_app(app)
    babel.configure(app)
    db.init_app(app)
    themes.configure(app)
    context_processors.configure(app)
    security.configure(app, db)
    configure_admin(app, admin)
    blueprints.load_form_folder(app)
    return app
Example #3
0
def configure_extensions(app, admin):
    logger.configure(app)
    cache.init_app(app)
    babel.configure(app)
    db.init_app(app)
    themes.configure(app)
    context_processors.configure(app)
    security.configure(app, db)
    configure_admin(app, admin)
    blueprints.load_form_folder(app)
    return app
Example #4
0
def get_setting_value(key, default=None):
    try:
        return current_app.config.get(key, default)
    except RuntimeError:
        pass

    try:
        app = create_app_min()
        db.init_app(app)
        with app.app_context():
            return app.config.get(key, default)
    except:
        return default
Example #5
0
def get_setting_value(key, default=None):
    try:
        return current_app.config.get(key, default)
    except RuntimeError as e:
        logger.warning("current_app is inaccessible: %s" % e)

    try:
        app = create_app_min()
        db.init_app(app)
        with app.app_context():
            return app.config.get(key, default)
    except:
        return default
Example #6
0
def get_setting_value(key, default=None):
    try:
        return current_app.config.get(key, default)
    except RuntimeError as e:
        logger.warning('current_app is inaccessible: %s' % e)

    try:
        app = create_app_min()
        db.init_app(app)
        with app.app_context():
            return app.config.get(key, default)
    except:
        return default
Example #7
0
def configure_extensions(app, admin):
    cache.init_app(app)
    babel.configure(app)
    generic.configure(app)
    Mail(app)
    Dealer(app)
    error_handlers.configure(app)
    db.init_app(app)

    themes.configure(app, db)  # Themes should be configured after db

    context_processors.configure(app)
    template_filters.configure(app)

    app.security = Security(app, MongoEngineUserDatastore(db, User, Role))

    fixtures.configure(app, db)
    blueprints.load_from_packages(app)
    blueprints.load_from_folder(app)

    # enable .pdf support for posts
    weasyprint.configure(app)

    configure_admin(app, admin)

    if app.config.get('DEBUG_TOOLBAR_ENABLED'):
        try:
            from flask_debugtoolbar import DebugToolbarExtension
            DebugToolbarExtension(app)
        except:
            pass

    before_request.configure(app)
    views.configure(app)

    oauthlib.configure(app)

    if app.config.get('SENTRY_ENABLED', False):
        from .sentry import configure
        configure(app)

    return app
Example #8
0
def configure_extensions(app, admin):
    cache.init_app(app)
    babel.configure(app)
    generic.configure(app)
    Mail(app)
    error_handlers.configure(app)
    db.init_app(app)
    themes.configure(app)
    context_processors.configure(app)
    template_filters.configure(app)
    security.configure(app, db)
    fixtures.configure(app, db)
    # blueprints.load_from_packages(app)
    blueprints.load_from_folder(app)
    weasyprint.configure(app)
    configure_admin(app, admin)
    development.configure(app, admin)
    before_request.configure(app)
    views.configure(app)
    oauthlib.configure(app)
    return app
Example #9
0
def configure_extensions_min(app, admin):
    db.init_app(app)
    security.init_app(app, db)
    return app
Example #10
0
def configure_extensions_min(app, *args, **kwargs):
    db.init_app(app)
    security.init_app(app, db)
    return app