示例#1
0
文件: app.py 项目: messense/everbean
def register_extensions(app):
    from flask.ext.turbolinks import turbolinks
    from everbean.core import db, celery, assets
    from everbean.core import mail, limiter

    db.init_app(app)
    cache.init_app(app)
    celery.config_from_object(app.config)
    login_manager.init_app(app)
    mail.init_app(app)
    turbolinks(app)
    assets.init_app(app)
    limiter.init_app(app)

    if app.config['USE_SERVER_SIDE_SESSION']:
        from flask.ext.session import Session

        Session(app)

    if app.debug:
        # load debug toobar
        from flask.ext.debugtoolbar import DebugToolbarExtension
        # disable redirection interception of Flask-DebugToobar
        app.config['DEBUG_TB_INTERCEPT_REDIRECTS'] = False
        DebugToolbarExtension(app)
示例#2
0
def register_extensions(app):
    db.init_app(app)
    assets.init_app(app)
    mail.init_app(app)
    turbolinks(app)
    cache.init_app(app)

    if app.debug:
        from flask_debugtoolbar import DebugToolbarExtension
        DebugToolbarExtension(app)
示例#3
0
def register_extensions(app):
    db.init_app(app)
    assets.init_app(app)
    mail.init_app(app)
    turbolinks(app)
    cache.init_app(app)

    if app.debug:
        from flask_debugtoolbar import DebugToolbarExtension
        DebugToolbarExtension(app)
示例#4
0
文件: app.py 项目: NyankoRevo/Gather
def register_extensions(app):
    db.init_app(app)
    assets.init_app(app)
    mail.init_app(app)
    turbolinks(app)
    cache.init_app(app)
    api_manager.init_app(app, flask_sqlalchemy_db=db)

    if app.debug:
        from flask_debugtoolbar import DebugToolbarExtension
        DebugToolbarExtension(app)
示例#5
0
def register_extensions(app):
    db.init_app(app)
    assets.init_app(app)
    mail.init_app(app)
    turbolinks(app)
    cache.init_app(app)
    api_manager.init_app(app, flask_sqlalchemy_db=db)

    if app.debug:
        from flask_debugtoolbar import DebugToolbarExtension
        DebugToolbarExtension(app)