Initial content as generated from scaffold
This commit is contained in:
commit
9b0bbb74c2
27 changed files with 748 additions and 0 deletions
35
rattail_tutorial/web/app.py
Normal file
35
rattail_tutorial/web/app.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
# -*- coding: utf-8; mode: python; -*-
|
||||
"""
|
||||
Rattail Tutorial web app
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
from tailbone import app
|
||||
|
||||
|
||||
def main(global_config, **settings):
|
||||
"""
|
||||
This function returns a Pyramid WSGI application.
|
||||
"""
|
||||
# prefer Rattail Tutorial templates over Tailbone
|
||||
settings.setdefault('mako.directories', ['rattail_tutorial.web:templates',
|
||||
'tailbone:templates',])
|
||||
|
||||
# for graceful handling of postgres restart
|
||||
settings.setdefault('retry.attempts', 2)
|
||||
|
||||
# make config objects
|
||||
rattail_config = app.make_rattail_config(settings)
|
||||
pyramid_config = app.make_pyramid_config(settings)
|
||||
|
||||
# bring in the rest of Rattail Tutorial
|
||||
pyramid_config.include('rattail_tutorial.web.static')
|
||||
pyramid_config.include('rattail_tutorial.web.subscribers')
|
||||
pyramid_config.include('rattail_tutorial.web.views')
|
||||
|
||||
# for graceful handling of postgres restart
|
||||
pyramid_config.add_tween('tailbone.tweens.sqlerror_tween_factory',
|
||||
under='pyramid_tm.tm_tween_factory')
|
||||
|
||||
return pyramid_config.make_wsgi_app()
|
Loading…
Add table
Add a link
Reference in a new issue