mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-19 06:40:22 +00:00
Changed my mind about 04aa72c1f9. It's
just a better description, even if different strategies can change the
behavior so it isn't really very cache-like.
20 lines
730 B
Python
20 lines
730 B
Python
from appconf import AppConf
|
|
from django.conf import settings
|
|
|
|
|
|
class ImageKitConf(AppConf):
|
|
CACHEFILE_NAMER = 'imagekit.cachefiles.namers.hash'
|
|
SPEC_CACHEFILE_NAMER = 'imagekit.cachefiles.namers.source_name_as_path'
|
|
CACHEFILE_DIR = 'CACHE/images'
|
|
DEFAULT_CACHEFILE_BACKEND = 'imagekit.cachefiles.backends.Simple'
|
|
DEFAULT_CACHEFILE_STRATEGY = 'imagekit.cachefiles.strategies.JustInTime'
|
|
|
|
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
|
|
|
|
CACHE_BACKEND = None
|
|
CACHE_PREFIX = 'imagekit:'
|
|
|
|
def configure_cache_backend(self, value):
|
|
if value is None:
|
|
value = 'django.core.cache.backends.dummy.DummyCache' if settings.DEBUG else 'default'
|
|
return value
|