Ticket #1680: tg2-default-template-config.patch
| File tg2-default-template-config.patch, 3.2 kB (added by lmacken, 5 months ago) |
|---|
-
decorators/__init__.py
old new 5 5 needed to support these decorators.""" 6 6 7 7 import formencode 8 9 from pylons import config 8 10 from paste.util.mimeparse import best_match 9 11 10 12 def _schema(d=None, **kw): … … 177 179 elif ':' in template: 178 180 engine, template = template.split(':', 1) 179 181 elif template: 180 #TODO: lookup the default template engine from the config. 181 engine, template = 'genshi', template 182 engine = config['buffet.template_engines'][0]['engine'] 182 183 else: 183 184 engine, template = None, None 184 185 if content_type is None: -
templates/turbogears/+package+/config/middleware.py_tmpl
old new 17 17 18 18 19 19 from ${package}.config.environment import load_environment 20 from ${package}.controllers.root import RootController21 20 22 21 def make_app(global_conf, full_stack=True, **app_conf): 23 22 """Create a Pylons WSGI application and return it … … 39 38 """ 40 39 # Configure the Pylons environment 41 40 load_environment(global_conf, app_conf) 41 42 from ${package}.controllers.root import RootController 42 43 43 44 # Create the TurboGears WSGI app stack 44 45 app = PylonsApp() -
templates/turbogears/+package+/config/environment.py_tmpl
old new 38 38 config['routes.map'] = make_map() 39 39 config['pylons.app_globals'] = app_globals.Globals() 40 40 config['pylons.app_globals'].sa_engine = engine_from_config(config, 'sqlalchemy.') 41 41 42 43 # If you'd like to change the default template engine used to render 44 # text/html content, edit these options. 45 template_engine = 'genshi' 46 template_engine_options = {} 47 48 config['buffet.template_engines'].pop() 49 config.add_template_engine(template_engine, '${package}.templates', 50 template_engine_options) 51 42 52 # Pass the engine to initmodel, to be able to introspect tables 43 53 engine = engine_from_config(config, 'sqlalchemy.') 44 54 init_model(engine) -
templates/turbogears/development.ini_tmpl
old new 43 43 sqlalchemy.echo_pool = false 44 44 sqlalchemy.pool_recycle = 3600 45 45 46 # If you'd like to change the default template engine used to render text/html47 # content, edit this line.48 template_engine.default = genshi49 50 46 # WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* 51 47 # Debug mode will enable the interactive debugging tool, allowing ANYONE to 52 48 # execute malicious code after an exception is raised.