2012-10-22 01:52:59 +00:00
|
|
|
.. _settings:
|
|
|
|
|
|
|
|
|
|
Configuration
|
|
|
|
|
=============
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Settings
|
|
|
|
|
--------
|
|
|
|
|
|
|
|
|
|
.. currentmodule:: django.conf.settings
|
|
|
|
|
|
|
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
.. attribute:: IMAGEKIT_CACHEFILE_DIR
|
2012-10-22 01:52:59 +00:00
|
|
|
|
|
|
|
|
:default: ``'CACHE/images'``
|
|
|
|
|
|
|
|
|
|
The directory to which image files will be cached.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. attribute:: IMAGEKIT_DEFAULT_FILE_STORAGE
|
|
|
|
|
|
|
|
|
|
:default: ``None``
|
|
|
|
|
|
|
|
|
|
The qualified class name of a Django storage backend to use to save the
|
|
|
|
|
cached images. If no value is provided for ``IMAGEKIT_DEFAULT_FILE_STORAGE``,
|
2013-09-05 14:42:09 +00:00
|
|
|
and none is specified by the spec definition, `your default file storage`__
|
2012-10-22 01:52:59 +00:00
|
|
|
will be used.
|
|
|
|
|
|
|
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
.. attribute:: IMAGEKIT_DEFAULT_CACHEFILE_BACKEND
|
2012-10-22 01:52:59 +00:00
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
:default: ``'imagekit.cachefiles.backends.Simple'``
|
2012-10-22 01:52:59 +00:00
|
|
|
|
|
|
|
|
Specifies the class that will be used to validate cached image files.
|
|
|
|
|
|
|
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
.. attribute:: IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY
|
2012-10-22 01:52:59 +00:00
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
:default: ``'imagekit.cachefiles.strategies.JustInTime'``
|
2012-10-22 01:52:59 +00:00
|
|
|
|
|
|
|
|
The class responsible for specifying how and when cache files are
|
|
|
|
|
generated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.. attribute:: IMAGEKIT_CACHE_BACKEND
|
|
|
|
|
|
2015-10-30 23:22:55 +00:00
|
|
|
:default: ``'default'``
|
2012-10-22 01:52:59 +00:00
|
|
|
|
2015-10-30 23:22:55 +00:00
|
|
|
The Django cache backend alias to retrieve the shared cache instance defined
|
|
|
|
|
in your settings, as described in the `Django cache section`_.
|
|
|
|
|
|
|
|
|
|
The cache is then used to store information like the state of cached
|
|
|
|
|
images (i.e. validated or not).
|
|
|
|
|
|
|
|
|
|
.. _`Django cache section`: https://docs.djangoproject.com/en/1.8/topics/cache/#accessing-the-cache
|
2012-10-22 01:52:59 +00:00
|
|
|
|
|
|
|
|
|
2017-02-08 22:44:32 +00:00
|
|
|
.. attribute:: IMAGEKIT_CACHE_TIMEOUT
|
|
|
|
|
|
|
|
|
|
:default: ``None``
|
|
|
|
|
|
|
|
|
|
Use when you need to override the timeout used to cache file state.
|
|
|
|
|
By default it is "cache forever".
|
|
|
|
|
It's highly recommended that you use a very high timeout.
|
|
|
|
|
|
|
|
|
|
|
2012-10-22 01:52:59 +00:00
|
|
|
.. attribute:: IMAGEKIT_CACHE_PREFIX
|
|
|
|
|
|
|
|
|
|
:default: ``'imagekit:'``
|
|
|
|
|
|
|
|
|
|
A cache prefix to be used when values are stored in ``IMAGEKIT_CACHE_BACKEND``
|
|
|
|
|
|
|
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
.. attribute:: IMAGEKIT_CACHEFILE_NAMER
|
2012-10-22 01:52:59 +00:00
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
:default: ``'imagekit.cachefiles.namers.hash'``
|
2012-10-22 01:52:59 +00:00
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
A function responsible for generating file names for non-spec cache files.
|
2012-10-22 01:52:59 +00:00
|
|
|
|
|
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
.. attribute:: IMAGEKIT_SPEC_CACHEFILE_NAMER
|
2012-10-22 01:52:59 +00:00
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
:default: ``'imagekit.cachefiles.namers.source_name_as_path'``
|
2012-10-22 01:52:59 +00:00
|
|
|
|
2013-02-06 02:12:39 +00:00
|
|
|
A function responsible for generating file names for cache files that
|
|
|
|
|
correspond to image specs. Since you will likely want to base the name of
|
|
|
|
|
your cache files on the name of the source, this extra setting is provided.
|
2013-09-05 14:42:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
__ https://docs.djangoproject.com/en/dev/ref/settings/#default-file-storage
|