Django REST Framework¶
Requires the drf extra. See Django REST Framework for
installation, configuration, and usage.
-
class imgproxykit.integrations.drf.ImgproxyURLField(*, transform: Transform | str | None =
None, **kwargs: Any)[source]¶ Represent a source string or model file as a read-only imgproxy URL.
Use Django’s
IMGPROXYKITsettings without request context. Empty sources returnNonewithout calling the source resolver.read_onlymust beTrueandwrite_onlymust beFalse.- Parameters:¶
Configure the transformation and DRF field options.
- class imgproxykit.integrations.drf.ImgproxyVariantsField(*, variants: Mapping[str, Transform] | str, **kwargs: Any)[source]¶
Represent a source as a read-only dictionary of named imgproxy URLs.
Use Django’s
IMGPROXYKITsettings and resolve the source once for all variants. Empty sources returnNonewithout calling the resolver.read_onlymust beTrueandwrite_onlymust beFalse.childcannot be supplied; variant values always use a URL field.- Parameters:¶
Configure the variants and DRF field options.