From 345b38898a5bb6897289627398a753702f118e36 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 2 Jul 2010 17:47:27 -0500 Subject: 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 --- settings.py | 14 +++++++++----- 1 file 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_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' -- cgit v1.2.3-54-g00ecf