# -*- coding: utf-8 -*- """ Global configuration file for TG2-specific settings in {{project}}. This file complements development/deployment.ini. Please note that **all the argument values are strings**. If you want to convert them into boolean, for example, you should use the :func:`paste.deploy.converters.asbool` function, as in:: from paste.deploy.converters import asbool setting = asbool(global_conf.get('the_setting')) """ from tg.configuration import AppConfig from tg.util import Bunch import {{package}} from {{package}} import model from {{package}}.lib import app_globals, helpers base_config = AppConfig() base_config.renderers = [] base_config.package = {{package}} #Set the default renderer base_config.default_renderer = 'mako' base_config.renderers.append('mako') #Configure the base SQLALchemy Setup base_config.use_sqlalchemy = True base_config.model = {{package}}.model base_config.DBSession = {{package}}.model.DBSession # Skip the normal TG auth middleware base_config.auth_backend = None # Configure the authentication backend base_config.baz_auth = Bunch() base_config.baz_auth.dbsession = model.DBSession base_config.baz_auth.cookie_secret = '{{secret}}' # You may optionally define a page where you want users to be redirected to # on login: base_config.baz_auth.post_login_url = '/post_login' # You may optionally define a page where you want users to be redirected to # on logout: base_config.baz_auth.post_logout_url = '/post_logout' # We use Bazki's transaction manager, not TurboGears's base_config.use_transaction_manager = False # Thunk this so that the config's available when controllers get imported def init(): from bazki import turbogears as baztg baztg.init() base_config.call_on_startup.append(init)