[Answer]-Is there any way to pass parameter for art_work for t300x300 image?

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

Leave a comment