source: rattail-demo/rattail_demo/web/app.py @ 5c3a959

Last change on this file since 5c3a959 was 5c3a959, checked in by Lance Edgar <ledgar@…>, 7 months ago

Remove CORE-POS web views logic

all the views are still visible in our app, but the view logic belongs in
tailbone-corepos now

  • Property mode set to 100644
File size: 1.3 KB
Line 
1# -*- coding: utf-8; -*-
2"""
3Pyramid web application
4"""
5
6from __future__ import unicode_literals, absolute_import
7
8from tailbone import app
9from tailbone_corepos.db import CoreOfficeSession, CoreTransSession
10
11
12def main(global_config, **settings):
13    """
14    This function returns a Pyramid WSGI application.
15    """
16    # prefer demo templates over tailbone
17    settings.setdefault('mako.directories', ['rattail_demo.web:templates',
18                                             'tailbone:templates',])
19
20    # for graceful handling of postgres restart
21    settings.setdefault('retry.attempts', 2)
22
23    # make config objects
24    rattail_config = app.make_rattail_config(settings)
25    pyramid_config = app.make_pyramid_config(settings)
26
27    # configure database sessions
28    CoreOfficeSession.configure(bind=rattail_config.corepos_engine)
29    CoreTransSession.configure(bind=rattail_config.coretrans_engine)
30
31    # bring in rest of rattail-demo etc.
32    pyramid_config.include('tailbone.static')
33    pyramid_config.include('rattail_demo.web.subscribers')
34    pyramid_config.include('rattail_demo.web.views')
35
36    # for graceful handling of postgres restart
37    pyramid_config.add_tween('tailbone.tweens.sqlerror_tween_factory',
38                             under='pyramid_tm.tm_tween_factory')
39
40    return pyramid_config.make_wsgi_app()
Note: See TracBrowser for help on using the repository browser.