About Deleting Versions for a Particular Image with django-imagekit
The django-imagekit library creates image versions with filenames based on hashed values. That's quite tricky to track. Here is an example function to find existing versions and delete them from the file system:
1 2 3 4 5 6 7 8 9 10 |
|
Then you can call it for an image field:
1 2 |
|
Tips and Tricks Programming Development Django 4.2 Django 3.2 Django 2.2 Pillow django-imagekit
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.