amue/settings.py: use cached template loader if DEBUG is False

This commit is contained in:
Benjamin Dauvergne 2013-12-10 11:01:43 +01:00
parent e9dbe25407
commit f03454a439
1 changed files with 11 additions and 4 deletions

View File

@ -57,10 +57,17 @@ if 'STATICFILES_DIRS' in os.environ:
else:
STATICFILES_DIRS = ('/var/lib/%s/extra-static/' % PROJECT_NAME,)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
if DEBUG:
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
else:
TEMPLATE_LOADERS = (
('django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',)),
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',