Example #1
0
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    engine = engine_from_config(settings, 'sqlalchemy.')
    initialize_sql(engine)
    config = Configurator(settings=settings)

    config.add_static_view('static', 'ruop:static')
    config.add_route('home', '/')
    config.add_route('details', '/details')
    config.add_route('details_reference', '/details/{reference}')

    config.add_view('ruop.views.my_view',
                    route_name='home',
                    renderer='templates/mytemplate.pt')
    config.scan()
    return config.make_wsgi_app()
Example #2
0
def _initTestingDB():
    from sqlalchemy import create_engine
    from ruop.models import initialize_sql
    session = initialize_sql(create_engine('sqlite://'))
    return session