diff options
author | Dan McGee <dan@archlinux.org> | 2010-07-03 00:47:27 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-07-03 00:47:27 +0200 |
commit | 345b38898a5bb6897289627398a753702f118e36 (patch) | |
tree | 42f35d8380d5066d78f41041145b6732d5e18d63 | |
parent | 86d503af5a68a8e0b13f565d6960125bdacf6936 (diff) | |
download | archweb-345b38898a5bb6897289627398a753702f118e36.tar.gz archweb-345b38898a5bb6897289627398a753702f118e36.tar.xz |
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>
-rw-r--r-- | settings.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/settings.py b/settings.py index fb2efcb..9f025ad 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' |