Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use the built-in caching template loader.

  • Loading branch information...
commit a836c3abc9ce58e472c074d8c9a8a7d652bcf2b3 1 parent a2cc958
@friedelwolff friedelwolff authored
Showing with 4 additions and 17 deletions.
  1. +4 −17 pootle/settings.py
View
21 pootle/settings.py
@@ -82,9 +82,10 @@
SECRET_KEY = '^&4$dlpce2_pnronsi289xd7-9ke10q_%wa@9srm@zaa!ig@1k'
TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.Loader',
- 'django.template.loaders.app_directories.Loader',
-# 'django.template.loaders.eggs.load_template_source',
+ ('django.template.loaders.cached.Loader', (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+ )),
)
MIDDLEWARE_CLASSES = (
@@ -254,17 +255,3 @@ def hijack_translation():
level=logging.INFO,
format='%(asctime)s %(levelname)s %(message)s',
)
-
-
-# cache template loading to reduce IO strain
-if not DEBUG:
- template_cache = {}
- def cache_templates(f):
- def decorated_f(template_name):
- if template_name not in template_cache:
- template_cache[template_name] = f(template_name)
- return template_cache[template_name]
- return decorated_f
-
- from django.template import loader
- loader.get_template = cache_templates(loader.get_template)
Please sign in to comment.
Something went wrong with that request. Please try again.