Example #1
0
def setup_app(config=None):
    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    db_api.setup_db()

    app = pecan.make_app(app_conf.pop('root'),
                         logging=getattr(config, 'logging', {}),
                         **app_conf)

    return app
Example #2
0
    def heavy_init(cls):
        """Runs a long initialization.

        This method runs long initialization  once by class
        and can be extended by child classes.
        """
        # If using sqlite, change to memory. The default is file based.
        if cfg.CONF.database.connection.startswith('sqlite'):
            cfg.CONF.set_default('connection', 'sqlite://', group='database')

        cfg.CONF.set_default('max_overflow', -1, group='database')
        cfg.CONF.set_default('max_pool_size', 1000, group='database')

        db_api_v2.setup_db()
def setup_app(config=None):
    if not config:
        config = get_pecan_config()

    app_conf = dict(config.app)

    db_api.setup_db()

    app = pecan.make_app(
        app_conf.pop('root'),
        logging=getattr(config, 'logging', {}),
        **app_conf
    )

    return app