Search code examples
djangosorl-thumbnail

sorl-thumbnail not linking properly


I installed sorl-thumbnail and a lot seems to go right. For every {% thumbnail %} tag some folders and a thumbnail image are created in a "cache" folder.

Inside the template the image url is rendered as something like "cache/7b/74/7b74e7338fd08c52e3ac7526aa5eb7b6.jpg", which seems correct as well. However no image is displayed. When I try following the cache link, it results in a 404 error.


Solution

  • On the rendered page, does the link starts like cache/7b/74... or is it /media/cache/7b/74 ?... if it's like the first one, then c&p the link and prepend /media/ to it. If the image shows, then the problem is the generated url.

    Also, if your problem is the missing /media/, take a look at this other question: Sorl-thumbnail bad url's