# Configuration

## Settings

django.conf.settings.IMAGEKIT_DEFAULT_THUMBNAIL_FORMAT
  Default:

    `None`

  The output format of the images generated by the `thumbnail` template tag.

django.conf.settings.IMAGEKIT_CACHEFILE_DIR
  Default:

    `'CACHE/images'`

  The directory to which image files will be cached.

django.conf.settings.IMAGEKIT_DEFAULT_THUMBNAIL_SRCSET_SCALES
  Default:

    `None`

  A list of scale factors, for example `[2, 3]`. If specified, every `<img>` generated by the `thumbnail` template tag will have a `srcset` attribute with the given scales. To prevent this, set `srcset=None`.

django.conf.settings.IMAGEKIT_DEFAULT_FILE_STORAGE
  Default:

    `None`

  Starting with Django 4.2, if you defined `settings.STORAGES`: the Django storage backend alias to retrieve the storage instance defined in your settings, as described in the Django file storage documentation. If no value is provided for `IMAGEKIT_DEFAULT_FILE_STORAGE`, and none is specified by the spec definition, the `default` file storage will be used.

  Before Django 4.2, or if `settings.STORAGES` is not defined: 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`, and none is specified by the spec definition, your default file storage will be used.

django.conf.settings.IMAGEKIT_DEFAULT_CACHEFILE_BACKEND
  Default:

    `'imagekit.cachefiles.backends.Simple'`

  Specifies the class that will be used to validate cached image files.

django.conf.settings.IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY
  Default:

    `'imagekit.cachefiles.strategies.JustInTime'`

  The class responsible for specifying how and when cache files are generated.

django.conf.settings.IMAGEKIT_CACHE_BACKEND
  Default:

    `'default'`

  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.conf.settings.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.

django.conf.settings.IMAGEKIT_CACHE_PREFIX
  Default:

    `'imagekit:'`

  A cache prefix to be used when values are stored in `IMAGEKIT_CACHE_BACKEND`

django.conf.settings.IMAGEKIT_CACHEFILE_NAMER
  Default:

    `'imagekit.cachefiles.namers.hash'`

  A function responsible for generating file names for non-spec cache files.

django.conf.settings.IMAGEKIT_SPEC_CACHEFILE_NAMER
  Default:

    `'imagekit.cachefiles.namers.source_name_as_path'`

  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.