sorl thumbnail not working

361 views Asked by At

I'm having an issue with getting sorl thumbnail to work.

I've added sorl.thumbnail to INSTALLED_APPS and in the template at the top

{% extends 'base.html' %}
{% load thumbnail %}

I've also checked if pillow is properly installed.

Tested it

<span class="test">{% thumbnail "http://animal-dream.com/data_images/cow/cow5.jpg" "1300x700" as image %}{{ image.url }}{% endthumbnail %}</span>

Did the above just to see the output. When I check

$('.test')
<span class=​"test">​</span>​
2

There are 2 answers

0
Andrew Louis On BEST ANSWER

Yep migrate it with this commands

./manage.py makemigrations thumbnail

./manage.py migrate

0
Samuel Muiruri On

The Solution is you need to run migrate so it creates tables first otherwise thumbnail tag wont work.