Registry / web-framework / django-versatileimagefield

django-versatileimagefield

JSON →
library3.1pypypi✓ verified 82d ago

A drop-in replacement for Django's ImageField that provides a flexible interface for creating new images (e.g., thumbnails) from the one assigned to the field. Current version: 3.1. Release cadence is irregular; maintained by RespondCreate.

pip install django-versatileimagefield
INSTALL
IMPORT
SIG · DJANGO-VERSATILEIM
D
django-versatileimagefield
web-frameworkpythonv3.1
Install
4.0s avg
Import
Disk
86MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 86.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.0s · import 0.000s · 87MB
86MB installed
● package 86MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default_app_config
from versatileimagefield import default_app_config
from versatileimagefield.fields import VersatileImageField

Define a model with VersatileImageField and associated PPOIField. Then run makemigrations and migrate.

from django.db import models from versatileimagefield.fields import VersatileImageField, PPOIField class Product(models.Model): name = models.CharField(max_length=255) image = VersatileImageField( upload_to='products/', ppoi_field='image_ppoi' ) image_ppoi = PPOIField() class Meta: app_label = 'myapp'
Debug
Known issues
gotchaIf you don't add a PPOIField when using ppoi_field, the field will raise an error on first access or S3 upload (key validation fails).
fix
Always define a PPOIField with the same name as the ppoi_field argument.
affects: all
gotchaWhen using S3 as the storage backend (e.g., django-storages), create_on_demand=False is not supported; always set it to True or omit. The default True is safe.
fix
Omit create_on_demand argument or set it to True.
affects: all
deprecatedImageDetailFilter and 'sizedimage_set' queryset filters are deprecated in favor of the registry API (create_sized_image_url).
fix
Use `create_sized_image_url` or the `build_url` method on the image field.
affects: 2.0+
breakingDropped support for Python 2.7, Django <1.11. Requires Django >=2.2 and Python >=3.5.
fix
Upgrade to Python 3.5+ and Django 2.2+.
affects: 2.0+
Upgrade
Version history
3.1latest on PyPI · released Jan 21, 2024
Audit
Dependencies
DjangorequiredCore dependency; requires Django 2.2+ (including 4.x)
PillowrequiredRequired for image processing
Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
django-versatileimagefield — pip install django-versatileimagefield · libregistry