Skip to content

meringue.conf.default_settings ¤

UPLOAD_RENAME_HANDLER module-attribute ¤

UPLOAD_RENAME_HANDLER: Final[str] = (
    "meringue.core.upload_handlers.rename_handler"
)

Path to method for renaming images on upload

COP_YEAR module-attribute ¤

COP_YEAR: Final[int | None] = None

Project start year for the copyright tag

COP_YEARS_DIFF module-attribute ¤

COP_YEARS_DIFF: Final[int] = 10

Difference in years for which it is necessary to display the range of years

Specify 1 to display the period for the second year.

CRYPTO_KEY module-attribute ¤

CRYPTO_KEY: Final[str] = SECRET_KEY[:32]

Encryption key

FRONTEND_URLS module-attribute ¤

FRONTEND_URLS: Final[dict | None] = None

A dict of links to the frontend

FRONTEND_DOMAIN module-attribute ¤

FRONTEND_DOMAIN: Final[str | None] = None

Domain for generating absolute links

API_ENABLE_ROOT_VIEW module-attribute ¤

API_ENABLE_ROOT_VIEW: Final[bool] = DEBUG

Option to enable or disable the root view of the Router

THUMBNAIL_GENERATOR_CLASS module-attribute ¤

THUMBNAIL_GENERATOR_CLASS: Final[str] = (
    "meringue.thumbnail.generators.Thumbnailer"
)

Thumbnail generator class.

THUMBNAIL_STORAGE_GETTER module-attribute ¤

THUMBNAIL_STORAGE_GETTER: Final[str] = (
    "meringue.thumbnail.storage.get_storage"
)

Dotted path to a method that returns a store.

THUMBNAIL_IMAGE_CLASS module-attribute ¤

THUMBNAIL_IMAGE_CLASS: Final[str] = (
    "meringue.thumbnail.images.ThumbnailImage"
)

Thumbnail image class.

THUMBNAIL_DIR module-attribute ¤

THUMBNAIL_DIR: Final[Path] = Path(MEDIA_ROOT) / Path(
    "m/thumbnail"
)

Directory for saving thhumbnails.

THUMBNAIL_URL module-attribute ¤

THUMBNAIL_URL: Final[str] = urljoin(
    MEDIA_URL, "m/thumbnail"
)

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 ¤

THUMBNAIL_DEFAULT_CROP_METHOD: Final[list[str]] = [
    "center",
    "center",
]

Default crop method.

THUMBNAIL_DEFAULT_RESIZE_METHOD module-attribute ¤

THUMBNAIL_DEFAULT_RESIZE_METHOD: Final[str] = 'contain'

Default resize method.

THUMBNAIL_DEFAULT_RESIZE_STRATEGY module-attribute ¤

THUMBNAIL_DEFAULT_RESIZE_STRATEGY: Final[str] = 'standard'

Default resize strategy.

THUMBNAIL_DEFAULT_BG_COLOR module-attribute ¤

THUMBNAIL_DEFAULT_BG_COLOR: Final[tuple[int]] = (
    200,
    200,
    200,
    0,
)

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_DUMMYIMAGE_TEMPLATE module-attribute ¤

THUMBNAIL_DUMMYIMAGE_TEMPLATE: Final[str] = (
    "//dummyimage.com/{width}x{height}/9e9e9e/424242.png"
)

Template for dummy image URL. Supports {width} and {height} placeholders.

THUMBNAIL_DEFAULT_FORMAT module-attribute ¤

THUMBNAIL_DEFAULT_FORMAT: Final[str] = 'PNG'

Default thumbnail image format.

PROTECTED_SERVE_WITH_NGINX module-attribute ¤

PROTECTED_SERVE_WITH_NGINX: Final[bool] = not DEBUG

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.

PROTECTED_NGINX_LOCATION_GETTER module-attribute ¤

PROTECTED_NGINX_LOCATION_GETTER: Final[str] = (
    "meringue.protected.utils.nginx_location_getter"
)

Default getter for the link to the file where nginx should serve it after access verification.