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)
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()
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)