Initial commit from Paster template
[xonotic/xonstat.git] / xonstat / __init__.py
1 from pyramid.config import Configurator
2 from sqlalchemy import engine_from_config
3
4 from xonstat.models import initialize_sql
5
6 def main(global_config, **settings):
7     """ This function returns a Pyramid WSGI application.
8     """
9     engine = engine_from_config(settings, 'sqlalchemy.')
10     initialize_sql(engine)
11     config = Configurator(settings=settings)
12     config.add_static_view('static', 'xonstat:static')
13     config.add_route('home', '/', view='xonstat.views.my_view',
14                      view_renderer='templates/mytemplate.pt')
15     return config.make_wsgi_app()
16
17