Exemplo n.º 1
0
def main(global_config, **settings):
    """
    Main entry function

    :returns: a Pyramid WSGI application.
    """
    config = prepare_config(**settings)

    import logging
    logger = logging.getLogger(__name__)

    logger.debug("Setting up the bdd")
    dbsession = setup_bdd(settings)

    logger.debug("Loading views ...")
    config = base_configure(config, dbsession, **settings)

    logger.debug("Configuring file depot")
    configure_filedepot(settings)

    config.configure_celery(global_config['__file__'])

    config.commit()

    return config.make_wsgi_app()
Exemplo n.º 2
0
def config(request, pyramid_request, settings, registry):
    """ returns a Pyramid `Configurator` object initialized
        with Kotti's default (test) settings.
    """
    os.environ['TZ'] = "Europe/Paris"
    from pyramid_beaker import set_cache_regions_from_settings
    config = testing.setUp(
        registry=registry,
        settings=settings,
        request=pyramid_request
    )
    for include in settings['pyramid.includes'].split('\n'):
        include = include.strip()
        if include:
            config.include(include)
    set_cache_regions_from_settings(settings)
    request.addfinalizer(testing.tearDown)
    configure_filedepot(settings)

    from autonomie import setup_services, add_static_views
    setup_services(config, settings)
    add_static_views(config, settings)
    config.include('autonomie_celery')
    from autonomie.utils.renderer import customize_renderers
    customize_renderers(config)
    return config
Exemplo n.º 3
0
def main(global_config, **settings):
    """
        Main function : returns a Pyramid WSGI application.
    """
    engine = engine_from_config(settings, 'sqlalchemy.')
    config = prepare_config(**settings)

    dbsession = initialize_sql(engine)

    config = base_configure(config, dbsession, **settings)
    from autonomie.utils.filedepot import (
        configure_filedepot,
    )
    configure_filedepot(settings)
    config.configure_celery(global_config['__file__'])

    config.commit()
    # for i in config.introspector.get_category('permissions'):
    #     print(i['introspectable'].discriminator)

    return config.make_wsgi_app()
Exemplo n.º 4
0
def main(global_config, **settings):
    """
        Main function : returns a Pyramid WSGI application.
    """
    engine = engine_from_config(settings, 'sqlalchemy.')
    config = prepare_config(**settings)

    dbsession = initialize_sql(engine)

    config = base_configure(config, dbsession, **settings)
    from autonomie.utils.filedepot import (
        configure_filedepot,
    )
    configure_filedepot(settings)
    config.configure_celery(global_config['__file__'])

    config.commit()
    # for i in config.introspector.get_category('permissions'):
    #     print(i['introspectable'].discriminator)

    return config.make_wsgi_app()
Exemplo n.º 5
0
def config(request, pyramid_request, settings, registry):
    """ returns a Pyramid `Configurator` object initialized
        with Kotti's default (test) settings.
    """
    os.environ['TZ'] = "Europe/Paris"
    from pyramid_beaker import set_cache_regions_from_settings
    config = testing.setUp(registry=registry,
                           settings=settings,
                           request=pyramid_request)
    for include in settings['pyramid.includes'].split('\n'):
        include = include.strip()
        if include:
            config.include(include)
    set_cache_regions_from_settings(settings)
    request.addfinalizer(testing.tearDown)
    configure_filedepot(settings)

    from autonomie import setup_services
    setup_services(config, settings)
    config.include('autonomie_celery')
    from autonomie.utils.renderer import customize_renderers
    customize_renderers(config)
    return config