FAQ Database Discussion Community


sorl-thumbnail: Creating a thumbnail inside a for loop in a template

django,sorl-thumbnail
I am trying to create a thumbnail with the size of 100x100 px from an image. I am using a for loop, and the for loops works and the image is rendered but for some reason when I am trying to create a thumbnail it doesn't work. Here is my...

Creating thumbnails inside a for loop in Django template

django,image,sorl-thumbnail
I am facing a very strange (maybe silly) error. I am trying to generate thumbnails inside a for loop like this: {% for u in users %} <img src="{{ u.avatar.url }}" /> {% thumbnail "{{ u.avatar.url }}" "200x200" crop="center" as im %} <img src="{{im.url}}" width="{{im.width}}" height="{{im.height}}"> {% endthumbnail %} {%...