1👍
✅
You can use django-sorl-thumbnail, a very handy tool to resize images.
Some of the features include
- Very simple syntax
- Can use CSS to manipulate images
The usage is extremely simple:
{% load thumbnail %}
{% thumbnail track.artwork_url "300x300" crop="center" as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}">
{% endthumbnail %}
0👍
You’ll either have to find some way to resize the original images, although Django doesn’t provide any built-in mechanism to do this, so check this page for some options, or you can just ask the browser to resize it by using parameters on the <img>
tag like…
<img width="300" height="300" src="{{ track.artwork_url }}">
👤Aya
- [Answer]-Why am I getting a "IndexError: string index out of range" when loading this Django template?
- [Answer]-Finding whether two users have the same password
- [Answer]-Python – Django URLField
Source:stackexchange.com