Esempio n. 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', 'routes:static', cache_max_age=3600)
    config.add_route('home', '/')
    config.add_view('routes.views.my_view',
                    route_name='home',
                    renderer='templates/mytemplate.pt')
    return config.make_wsgi_app()
Esempio n. 2
0
def _initTestingDB():
    from sqlalchemy import create_engine
    from routes.models import initialize_sql
    session = initialize_sql(create_engine('sqlite://'))
    return session