mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-16 21:30:23 +00:00
parent
01a6c555a1
commit
bb7e9e5891
1 changed files with 10 additions and 5 deletions
|
|
@ -24,14 +24,19 @@ class ImageKitConf(AppConf):
|
|||
else:
|
||||
dummy_cache = 'django.core.cache.backends.dummy.DummyCache'
|
||||
|
||||
# DEFAULT_CACHE_ALIAS doesn't exist in Django<=1.2
|
||||
try:
|
||||
from django.core.cache import DEFAULT_CACHE_ALIAS as default_cache_alias
|
||||
except ImportError:
|
||||
default_cache_alias = 'default'
|
||||
|
||||
if settings.DEBUG:
|
||||
value = dummy_cache
|
||||
elif default_cache_alias in getattr(settings, 'CACHES', {}):
|
||||
value = default_cache_alias
|
||||
else:
|
||||
value = (
|
||||
getattr(settings, 'CACHES', {}).get('default')
|
||||
or getattr(settings, 'CACHE_BACKEND', None)
|
||||
or dummy_cache
|
||||
)
|
||||
value = getattr(settings, 'CACHE_BACKEND', None) or dummy_cache
|
||||
|
||||
return value
|
||||
|
||||
def configure_default_file_storage(self, value):
|
||||
|
|
|
|||
Loading…
Reference in a new issue