summaryrefslogtreecommitdiff
path: root/repoze
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-04-25 17:04:02 +0000
committerChris McDonough <chrism@agendaless.com>2010-04-25 17:04:02 +0000
commit7c525f127cee96a749e15b6ba2dfbc5379825178 (patch)
tree9b54b73c791484ddd13bb9613c0f8209f050323c /repoze
parenteac892170c9d1e889f2462dc59fe1a9b2b33c239 (diff)
downloadpyramid-7c525f127cee96a749e15b6ba2dfbc5379825178.tar.gz
pyramid-7c525f127cee96a749e15b6ba2dfbc5379825178.tar.bz2
pyramid-7c525f127cee96a749e15b6ba2dfbc5379825178.zip
- It is now possible to turn on Chameleon template "debugging mode"
for all Chameleon BFG templates by setting a BFG-related Paster ``.ini`` file setting named ``debug_templates``. The exceptions raised by Chameleon templates when a rendering fails are sometimes less than helpful. ``debug_templates`` allows you to configure your application development environment so that exceptions generated by Chameleon during template compilation and execution will contain more helpful debugging information. This mode is on by default in all new projects.
Diffstat (limited to 'repoze')
-rw-r--r--repoze/bfg/chameleon_text.py5
-rw-r--r--repoze/bfg/chameleon_zpt.py5
-rw-r--r--repoze/bfg/paster_templates/alchemy/+project+.ini_tmpl1
-rw-r--r--repoze/bfg/paster_templates/routesalchemy/+project+.ini_tmpl1
-rw-r--r--repoze/bfg/paster_templates/starter/+project+.ini_tmpl1
-rw-r--r--repoze/bfg/paster_templates/zodb/+project+.ini_tmpl1
6 files changed, 12 insertions, 2 deletions
diff --git a/repoze/bfg/chameleon_text.py b/repoze/bfg/chameleon_text.py
index deb1cc43d..73457a128 100644
--- a/repoze/bfg/chameleon_text.py
+++ b/repoze/bfg/chameleon_text.py
@@ -51,11 +51,14 @@ class TextTemplateRenderer(object):
def template(self):
settings = get_settings()
auto_reload = settings and settings['reload_templates']
+ debug = settings and settings['debug_templates']
reg = get_current_registry()
translate = None
if reg is not None:
translate = reg.queryUtility(IChameleonTranslate)
- return TextTemplateFile(self.path, auto_reload=auto_reload,
+ return TextTemplateFile(self.path,
+ auto_reload=auto_reload,
+ debug=debug,
translate=translate)
def implementation(self):
diff --git a/repoze/bfg/chameleon_zpt.py b/repoze/bfg/chameleon_zpt.py
index 687a11305..bacb102bb 100644
--- a/repoze/bfg/chameleon_zpt.py
+++ b/repoze/bfg/chameleon_zpt.py
@@ -34,11 +34,14 @@ class ZPTTemplateRenderer(object):
def template(self):
settings = get_settings()
auto_reload = settings and settings['reload_templates']
+ debug = settings and settings['debug_templates']
reg = get_current_registry()
translate = None
if reg is not None:
translate = reg.queryUtility(IChameleonTranslate)
- return PageTemplateFile(self.path, auto_reload=auto_reload,
+ return PageTemplateFile(self.path,
+ auto_reload=auto_reload,
+ debug=debug,
translate=translate)
def implementation(self):
diff --git a/repoze/bfg/paster_templates/alchemy/+project+.ini_tmpl b/repoze/bfg/paster_templates/alchemy/+project+.ini_tmpl
index 29fc7e806..1fa0609e0 100644
--- a/repoze/bfg/paster_templates/alchemy/+project+.ini_tmpl
+++ b/repoze/bfg/paster_templates/alchemy/+project+.ini_tmpl
@@ -6,6 +6,7 @@ use = egg:{{project}}#app
reload_templates = true
debug_authorization = false
debug_notfound = false
+debug_templates = true
default_locale_name = en
db_string = sqlite:///%(here)s/{{package}}.db
db_echo = false
diff --git a/repoze/bfg/paster_templates/routesalchemy/+project+.ini_tmpl b/repoze/bfg/paster_templates/routesalchemy/+project+.ini_tmpl
index c249172d3..4f9fd0b00 100644
--- a/repoze/bfg/paster_templates/routesalchemy/+project+.ini_tmpl
+++ b/repoze/bfg/paster_templates/routesalchemy/+project+.ini_tmpl
@@ -6,6 +6,7 @@ use = egg:{{package}}#app
reload_templates = true
debug_authorization = false
debug_notfound = false
+debug_templates = true
default_locale_name = en
db_string = sqlite:///%(here)s/{{package}}.db
diff --git a/repoze/bfg/paster_templates/starter/+project+.ini_tmpl b/repoze/bfg/paster_templates/starter/+project+.ini_tmpl
index 15be80cf4..9bdeec1ae 100644
--- a/repoze/bfg/paster_templates/starter/+project+.ini_tmpl
+++ b/repoze/bfg/paster_templates/starter/+project+.ini_tmpl
@@ -6,6 +6,7 @@ use = egg:{{project}}#app
reload_templates = true
debug_authorization = false
debug_notfound = false
+debug_templates = true
default_locale_name = en
[server:main]
diff --git a/repoze/bfg/paster_templates/zodb/+project+.ini_tmpl b/repoze/bfg/paster_templates/zodb/+project+.ini_tmpl
index 51b4e1ab8..993cec596 100644
--- a/repoze/bfg/paster_templates/zodb/+project+.ini_tmpl
+++ b/repoze/bfg/paster_templates/zodb/+project+.ini_tmpl
@@ -6,6 +6,7 @@ use = egg:{{project}}#app
reload_templates = true
debug_authorization = false
debug_notfound = false
+debug_templates = true
default_locale_name = en
zodb_uri = file://%(here)s/Data.fs?connection_cache_size=20000