diff --git a/theo/web/app.py b/theo/web/app.py index f1f73fb..564b89e 100644 --- a/theo/web/app.py +++ b/theo/web/app.py @@ -33,15 +33,22 @@ def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ - # prefer Theo templates over Tailbone - settings.setdefault('mako.directories', ['theo.web:templates', - 'tailbone:templates',]) + # establish rattail config + rattail_config = app.make_rattail_config(settings) + + # which template directories we want depends on integration + directories = ['theo.web:templates'] + if integrate_corepos(rattail_config): + directories.append('tailbone_corepos:templates') + if integrate_catapult(rattail_config): + directories.append('tailbone_onager:templates') + directories.append('tailbone:templates') + settings.setdefault('mako.directories', directories) # for graceful handling of postgres restart settings.setdefault('retry.attempts', 2) - # make config objects - rattail_config = app.make_rattail_config(settings) + # establish pyramid config pyramid_config = app.make_pyramid_config(settings) # maybe configure integration db connections