[Django]-Sorl-thumbnail's template tags do nothing

3๐Ÿ‘

โœ…

Your code looks fine, so the problem should come from other parts.

The first thing you can do is to set THUMBNAIL_DEBUG = True in your settings.py and see why the error occurs.

Are you using virualenv and PIL for image library? Make sure your PIL is compiled and installed with jpeg and png/gif support which requires libjpeg and zlib.

Edit: As @DanielRoseman pointed out in the comment, you are actually using django.db.models.ImageField, changing

image = models.ImageField(upload_to="uploads")

to

image = ImageField(upload_to="uploads")

to use sorl.thumbnail.ImageField instead.

๐Ÿ‘คK Z

0๐Ÿ‘

Try doing a cleanup, or if that fails, clear. Documentation

This resolved the problem for me when I was getting unexpected output. Maybe it will work for you.

๐Ÿ‘คKeith

Leave a comment