Question

I am trying to use sorl-thumbnail to provide image thumbnails. I have followed the documentation properly.

  1. I have installed memchached for windows, configured in the setting.py file.
  2. I have also installed Python Image Library
  3. I have installed sorl-thumbnails

I tried to use it in the templates as shown in this example. I do not have any error, the templatetag is being loaded but when I try to display the image, it does not come up. What can be the possible reason for this.

Was it helpful?

Solution

I'm assuming you're getting 404 errors since you're not getting "loud" errors.

You need to prefix the url with your static URL (or media url - wherever you've configured static files to load from). If you're using django's staticfiles app, that would be

<img src="{{ STATIC_URL }}{{ image.url }}" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top