浏览代码

improve template loader see https://docs.djangoproject.com/en/1.2/ref/templates/api/#loader-types

steve 12 年之前
父节点
当前提交
bcb47feb47
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 4 2
      django-stripped/hello/hello/settings.py
  2. 4 2
      django/hello/hello/settings.py

+ 4 - 2
django-stripped/hello/hello/settings.py

@@ -85,8 +85,10 @@ SECRET_KEY = '_7mb6#v4yf@qhc(r(zbyh&z_iby-na*7wz&-v6pohsul-d#y5f'
 
 
 # List of callables that know how to import templates from various sources.
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
 TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.Loader',
-    'django.template.loaders.app_directories.Loader',
+    ('django.template.loaders.cached.Loader', (
+        'django.template.loaders.filesystem.Loader',
+        'django.template.loaders.app_directories.Loader',
+    ))
 )
 )
 
 
 MIDDLEWARE_CLASSES = (
 MIDDLEWARE_CLASSES = (

+ 4 - 2
django/hello/hello/settings.py

@@ -86,8 +86,10 @@ SECRET_KEY = '_7mb6#v4yf@qhc(r(zbyh&z_iby-na*7wz&-v6pohsul-d#y5f'
 
 
 # List of callables that know how to import templates from various sources.
 # List of callables that know how to import templates from various sources.
 TEMPLATE_LOADERS = (
 TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.Loader',
-    'django.template.loaders.app_directories.Loader',
+    ('django.template.loaders.cached.Loader', (
+        'django.template.loaders.filesystem.Loader',
+        'django.template.loaders.app_directories.Loader',
+    ))
 )
 )
 
 
 MIDDLEWARE_CLASSES = (
 MIDDLEWARE_CLASSES = (