示例#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
示例#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
示例#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
示例#4
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
示例#5
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