meringue.conf.default_settings ¤
UPLOAD_RENAME_HANDLER
module-attribute
¤
Path to method for renaming images on upload
COP_YEAR
module-attribute
¤
Project start year for the copyright tag
COP_YEARS_DIFF
module-attribute
¤
Difference in years for which it is necessary to display the range of years
Specify 1 to display the period for the second year.
FRONTEND_URLS
module-attribute
¤
A dict of links to the frontend
FRONTEND_DOMAIN
module-attribute
¤
Domain for generating absolute links
THUMBNAIL_GENERATOR_CLASS
module-attribute
¤
Thumbnail generator class.
THUMBNAIL_STORAGE_GETTER
module-attribute
¤
Dotted path to a method that returns a store.
THUMBNAIL_IMAGE_CLASS
module-attribute
¤
Thumbnail image class.
THUMBNAIL_DIR
module-attribute
¤
Directory for saving thhumbnails.
THUMBNAIL_URL
module-attribute
¤
Url where thumbnails will be available.
THUMBNAIL_PROPERTIES
module-attribute
¤
THUMBNAIL_PROPERTIES: Final[dict[str, str]] = {
"cm": "meringue.thumbnail.properties.set_crop_method",
"rm": "meringue.thumbnail.properties.set_resize_method",
"rs": "meringue.thumbnail.properties.set_resize_strategy",
"s": "meringue.thumbnail.properties.set_size",
"maxw": "meringue.thumbnail.properties.set_max_width",
"maxh": "meringue.thumbnail.properties.set_max_height",
"c": "meringue.thumbnail.properties.set_bg_color",
}
Registered thumbnail properties.
THUMBNAIL_ACTIONS
module-attribute
¤
THUMBNAIL_ACTIONS: Final[dict[str, str]] = {
"crop": "meringue.thumbnail.actions.crop",
"resize": "meringue.thumbnail.actions.resize",
}
Registered thumbnail actions.
THUMBNAIL_DEFAULT_CROP_METHOD
module-attribute
¤
Default crop method.
THUMBNAIL_DEFAULT_RESIZE_METHOD
module-attribute
¤
Default resize method.
THUMBNAIL_DEFAULT_RESIZE_STRATEGY
module-attribute
¤
Default resize strategy.
THUMBNAIL_DEFAULT_BG_COLOR
module-attribute
¤
Default background color for crop in RGBA format.
THUMBNAIL_SAVE_PARAMS_BY_FORMAT
module-attribute
¤
THUMBNAIL_SAVE_PARAMS_BY_FORMAT: Final[dict[str, dict]] = {
"GIF": {"optimize": True},
"JPEG": {"quality": 85, "optimize": True},
"PNG": {"optimize": True, "compress_level": 5},
"TIFF": {"quality": 85},
"WEBP": {"quality": 85},
}
List of default options for saving thumbnails images by format.
THUMBNAIL_IMAGE_OPTIMIZE_HANDLER
module-attribute
¤
Dotted path to a function that optimizes thumbnail image before saving it to storage. The function receives a ThumbnailImage instance and an in-memory image file and must return an in-memory image file.
THUMBNAIL_OPTIMIZERS
module-attribute
¤
Built-in thumbnail optimizer settings.
Keys are optimizer names, values are optimizer-specific settings. Empty dictionary disables built-in optimizers.
For oxipng, set binary to the oxipng executable path or command name.
The default command-line options can be overridden with the options value,
as either a string or a list of strings.
THUMBNAIL_DUMMYIMAGE_TEMPLATE
module-attribute
¤
THUMBNAIL_DUMMYIMAGE_TEMPLATE: Final[str] = (
"//dummyimage.com/{width}x{height}/9e9e9e/424242.png"
)
Template for dummy image URL in DEBUG mode. Supports {static_url}, {width} and {height}
placeholders (STATIC_URL and the final size of the thumbnail job chain).
THUMBNAIL_DUMMYIMAGE_URL
module-attribute
¤
Dummy image URL when DEBUG is off (see
get_dummy_image_url).
Supports {static_url} (STATIC_URL at the moment of the call), {width} and {height}
(the final size of the thumbnail job chain) placeholders.
The default images/noise.png is shipped with the meringue.thumbnail static files.
Examples:
THUMBNAIL_DEFAULT_FORMAT
module-attribute
¤
Default thumbnail image format.
THUMBNAIL_CACHE
module-attribute
¤
Alias of the Django cache (from CACHES) for thumbnail marks and locks. None disables it.
With the cache:
- the "thumbnail is saved" mark is kept in the cache, so the thumbnail storage is checked only
once per
THUMBNAIL_CACHE_TIMEOUT(useful for remote storages like S3); - only one process makes a new thumbnail: the lock is taken with
cache.add.
Use a cache shared by all processes (Redis, Memcached, database) for the lock to work.
THUMBNAIL_CACHE_TIMEOUT
module-attribute
¤
Timeout (in seconds) of the "thumbnail is saved" mark in THUMBNAIL_CACHE. None means forever.
THUMBNAIL_CACHE_LOCK_TIMEOUT
module-attribute
¤
Timeout (in seconds) of the thumbnail generation lock in THUMBNAIL_CACHE.
PROTECTED_SERVE_WITH_NGINX
module-attribute
¤
The option implies the distribution of protected files by nginx. Instead of serving the file in response.
The view x_accel_redirect_view adds the X-Accel-Redirect header with a link to the file.