Don't reference the old CACHE_BACKEND setting on projects using the Django 1.3 CACHES setting.

This commit is contained in:
Carl Meyer
2011-01-18 05:21:11 +08:00
committed by Jannis Leidel
parent 0855ad9258
commit b5455406ff

View File

@@ -54,4 +54,11 @@ PARSER = getattr(settings, 'COMPRESS_PARSER', 'compressor.parser.BeautifulSoupPa
VERBOSE = getattr(settings, "COMPRESS_VERBOSE", False)
# the cache backend to use
CACHE_BACKEND = getattr(settings, 'COMPRESS_CACHE_BACKEND', settings.CACHE_BACKEND)
CACHE_BACKEND = getattr(settings, 'COMPRESS_CACHE_BACKEND', None)
if CACHE_BACKEND is None:
# If we are on Django 1.3 AND using the new CACHES setting...
if getattr(settings, "CACHES", None):
CACHE_BACKEND = "default"
else:
# fallback for people still using the old CACHE_BACKEND setting
CACHE_BACKEND = settings.CACHE_BACKEND