Thumbnail display problem in django templates - sorl-thumbnail

35 views Asked by At

I hope you're all well. I'm making a small Django site, for the frontend I wanted to integrate thumbnail to properly visualize the graphics of the site but this is not displayed

So I went through 3 steps with the sorl-thumbnail github:

  1. pip install sorl-thumbnail
  2. in the django settings, specify 'sorl.thumbnail' in the apps section
  3. Put the following lines in a template where I want to display a thumbnail
{% load thumbnail %}
{% thumbnail item.image "100x100" crop="center" as im %}
    <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}">
{% endthumbnail %}

But nothing is displayed. Do you have any idea why?

0

There are 0 answers