summaryrefslogtreecommitdiff
path: root/settings.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-07-02 17:47:27 -0500
committerDan McGee <dan@archlinux.org>2010-07-02 17:47:27 -0500
commit345b38898a5bb6897289627398a753702f118e36 (patch)
tree42f35d8380d5066d78f41041145b6732d5e18d63 /settings.py
parent86d503af5a68a8e0b13f565d6960125bdacf6936 (diff)
Only use cached template loader in production
Otherwise it is really confusing when you make template changes during development and they don't show up immediately. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'settings.py')
-rw-r--r--settings.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/settings.py b/settings.py
index fb2efcbd..9f025ad2 100644
--- a/settings.py
+++ b/settings.py
@@ -64,13 +64,17 @@ TEMPLATE_DIRS = (
)
TEMPLATE_LOADERS = (
- ('django.template.loaders.cached.Loader', (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.eggs.Loader',
- 'django.template.loaders.app_directories.Loader',
- )),
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.eggs.Loader',
+ 'django.template.loaders.app_directories.Loader',
)
+# Enable caching templates in production environments
+if not TEMPLATE_DEBUG:
+ TEMPLATE_LOADERS = (
+ ('django.template.loaders.cached.Loader', TEMPLATE_LOADERS),
+ )
+
# Set django's User stuff to use our profile model
# format is app.model
AUTH_PROFILE_MODULE = 'main.UserProfile'