2016-10-06 11:48:32 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
Pyramid web application
|
|
|
|
"""
|
|
|
|
|
|
|
|
from __future__ import unicode_literals, absolute_import
|
|
|
|
|
|
|
|
from tailbone import app
|
|
|
|
|
|
|
|
|
|
|
|
def main(global_config, **settings):
|
|
|
|
"""
|
|
|
|
This function returns a Pyramid WSGI application.
|
|
|
|
"""
|
|
|
|
# set some defaults for PostgreSQL
|
|
|
|
app.provide_postgresql_settings(settings)
|
|
|
|
|
2016-12-07 20:24:11 -06:00
|
|
|
# prefer demo templates over tailbone; use 'better' theme
|
|
|
|
settings.setdefault('mako.directories', ['rattail_demo.web:templates',
|
2016-10-06 11:48:32 -05:00
|
|
|
'tailbone:templates/themes/better',
|
|
|
|
'tailbone:templates',])
|
|
|
|
|
|
|
|
# make config objects
|
|
|
|
rattail_config = app.make_rattail_config(settings)
|
|
|
|
pyramid_config = app.make_pyramid_config(settings)
|
|
|
|
|
2016-12-07 20:24:11 -06:00
|
|
|
# bring in rest of rattail-demo etc.
|
2016-10-06 11:48:32 -05:00
|
|
|
pyramid_config.include('tailbone.static')
|
|
|
|
pyramid_config.include('tailbone.subscribers')
|
2016-12-07 20:24:11 -06:00
|
|
|
pyramid_config.include('rattail_demo.web.views')
|
2016-10-06 11:48:32 -05:00
|
|
|
|
|
|
|
# configure PostgreSQL some more
|
|
|
|
app.configure_postgresql(pyramid_config)
|
|
|
|
|
|
|
|
return pyramid_config.make_wsgi_app()
|