示例#1
0
def setup_app(config):

    models.init_model()
    app_conf = dict(config.app)

    return make_app(app_conf.pop('root'),
                    logging=getattr(config, 'logging', {}),
                    **app_conf)
示例#2
0
def bootstrap_pecan(signal, sender):
    try:
        config_path = os.environ['PECAN_CONFIG']
    except KeyError:
        here = os.path.abspath(os.path.dirname(__file__))
        config_path = os.path.abspath(os.path.join(here, '../config/config.py'))

    pecan.configuration.set_config(config_path, overwrite=True)
    # Once configuration is set we need to initialize the models so that we can connect
    # to the DB wth a configured mapper.
    models.init_model()
示例#3
0
文件: async.py 项目: dmick/mita
def bootstrap_pecan(signal, sender):
    try:
        config_path = os.environ['PECAN_CONFIG']
    except KeyError:
        here = os.path.abspath(os.path.dirname(__file__))
        config_path = os.path.abspath(os.path.join(here, '../config/config.py'))

    pecan.configuration.set_config(config_path, overwrite=True)
    # Once configuration is set we need to initialize the models so that we can connect
    # to the DB wth a configured mapper.
    models.init_model()
示例#4
0
文件: app.py 项目: andrewschoen/mita
def setup_app(config):

    models.init_model()
    app_conf = dict(config.app)

    return make_app(app_conf.pop("root"), logging=getattr(config, "logging", {}), **app_conf)