2👍
✅
This is what worked for me:
Model:
class Model(models.Model):
image_1 = ProcessedImageField([Adjust(contrast=1.2, sharpness=1.1), ResizeToFill(500, 370)], upload_to=generate_image_filename_1, format='JPEG', options={'quality': 90})
thumbnail_1 = ImageSpec([Adjust(contrast=1.2, sharpness=1.1), ResizeToFill(83, 78)], image_field='image_1', cache_to=generate_cache_filename, format='JPEG', options={'quality': 90})
View:
def thumbnail(request, pk):
thumb_pk = pk
instance = Model.objects.get(pk=thumb_pk)
return render_to_response('thumbnail.html',{'instance': instance},context_instance = RequestContext(request))
Template ‘thumbnail.html’:
# show the tumbnail
<img alt="thumbnail" src="{{ instance.thumbnail_1.url }}" width="83" height="78">
Source:stackexchange.com