예제 #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
파일: async.py 프로젝트: ErwanAliasr1/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()
예제 #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)