Exemplo n.º 1
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    # Setup two db sessions. One using transactions (default) and one
    # without transactions.
    engine = setup_db_engine(settings)
    setup_db_session(engine, settings)
    Base.metadata.bind = engine
    config = Configurator(settings=settings,
                          locale_negotiator=locale_negotiator)
    config.set_session_factory(session_factory_from_settings(settings))
    config.include('ringo')
    return config.make_wsgi_app()
Exemplo n.º 2
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    # Setup two db sessions. One using transactions (default) and one
    # without transactions.
    engine = setup_db_engine(settings)
    setup_db_session(engine, settings)
    Base.metadata.bind = engine
    config = Configurator(settings=settings,
                          locale_negotiator=locale_negotiator)
    config.set_session_factory(session_factory_from_settings(settings))
    config.include('ringo')
    return config.make_wsgi_app()
Exemplo n.º 3
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    engine = setup_db_engine(settings)
    setup_db_session(engine)
    Base.metadata.bind = engine
    config = Configurator(settings=settings)
    # Include basic ringo configuration.
    config.include('ringo')
    config.include('plorma')
    for extension in extensions:
        config.include(extension)
    config.scan()
    return config.make_wsgi_app()
Exemplo n.º 4
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    # Setup two db sessions. One using transactions (default) and one
    # without transactions.
    databaseurl = os.environ.get('DATABASE_URL')
    if databaseurl:
        settings['sqlalchemy.url'] = databaseurl
        log.info("Using database url from ENV: %s" % databaseurl)
    engine = setup_db_engine(settings)
    setup_db_session(engine, settings)
    Base.metadata.bind = engine
    config = Configurator(settings=settings,
                          locale_negotiator=locale_negotiator)
    config.set_session_factory(session_factory_from_settings(settings))
    config.include('ringo')
    return config.make_wsgi_app()
Exemplo n.º 5
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    if not settings.get("strava.client_secret"):
        print(
            "Error. Client secret to access the Strava API is not configured.\n"
            "See documentation for more details.")
        sys.exit(1)
    engine = setup_db_engine(settings)
    setup_db_session(engine)
    Base.metadata.bind = engine
    config = Configurator(settings=settings)
    # Include basic ringo configuration.
    config.include('ringo')
    config.include('trainable')
    for extension in extensions:
        config.include(extension)
    config.scan()
    return config.make_wsgi_app()