Sorl-Thumbnail not appearing

154 views Asked by At

Firstly i'm very much a beginner and learning Django, but I just cannot get Sorl-Thumbnail to work in the Gallery aspects of a photography site I am developing.

The site is in development and DEBUG = True, all installs went well including dependencies as far as I can see. 'sorl.thumbnail', is added to apps and migrations have gone through.

I am using is to generate thumbnail within a template for loop to generate my galleries. But I get broken thumbnails for each image objects. On inspecting i get a tag img tag <img src="/media/cache/5c/58/5c58ba75425e372e94b739e292690b85.jpg">

All other images work in Admin, and on the rest of the site. I've checked MEDIA_URL but this seems ok. I cannot see a cache folder within my media folder though, does sorl generate one?

I've changed my model so it is using the Sorl-Thumnail imagefield, but this didn'd achieve anything, I have THUMBNAIL_DEBUG = True in setting but this is not giving me anything in terminal.

{% for img in album.images %}
{% thumbnail img "100x100" crop="center" as im %}
<img src="{{ im.url }}">
{% empty %}
1

There are 1 answers

1
Rob On

Well, I didin't manage to solve this. I 'think' it maybe a permissions problem (I'm using Windows) but I could never get any errors back from sorl-thumbnail so little info to go on. I worked on all the other solutions on SO but I could never get it to create the Cache folder.

I removed the module and used Imagekit in the end which worked like a charm. I'm just annoyed I never got to the bottom of my problem with Sorl.