Пример #1
0
def setting_app():
    app = Flask(__name__)

    # Redis conf
    app.config["REDIS_CONF"] = {
        "REDIS_STATUS": True,
        "REDIS_HOST": "127.0.0.1",
        "REDIS_PORT": 16379,
        "REDIS_PASSWORD": "******",
    }
    path_ = os.getcwd() + "/flask_state_host.db"
    app.config["SQLALCHEMY_BINDS"] = {DEFAULT_BIND_SQLITE: prefix + path_}

    # log_instance = logging.getLogger(__name__)
    # use init_app initial configuration
    init_app(app, interval=60)
    return app
Пример #2
0
def setting_app():
    app = Flask(__name__)

    # Redis conf
    app.config['REDIS_CONF'] = {
        'REDIS_STATUS': True,
        'REDIS_HOST': '192.168.0.2',
        'REDIS_PORT': 16379,
        'REDIS_PASSWORD': '******'
    }

    import os
    path_ = os.getcwd() + '/test.db'
    app.config['SQLALCHEMY_BINDS'] = {
        DEFAULT_BIND_SQLITE: 'sqlite:///' + path_
    }

    # log_instance = logging.getLogger(__name__)
    # use init_app initial configuration
    init_app(app, 60)
    return app
Пример #3
0
def setting_app():
    app = Flask(__name__)

    # Redis conf
    app.config["REDIS_CONF"] = {
        "REDIS_STATUS": True,
        "REDIS_HOST": "192.168.0.2",
        "REDIS_PORT": 16379,
        "REDIS_PASSWORD": "******",
    }

    import os

    path_ = os.getcwd() + "/flask_state_host.db"
    app.config["SQLALCHEMY_BINDS"] = {
        DEFAULT_BIND_SQLITE: "sqlite:///" + path_
    }

    # log_instance = logging.getLogger(__name__)
    # use init_app initial configuration
    init_app(app, interval=60)
    return app