帮助。我不知道如何通过缩略图将图像设置为背景?我需要通过缩略图插入背景。我该怎么做?
<section class="slider">
<div class="swiper-container">
<div class="swiper-wrapper">
{% for new in news %}
{% load thumbnail %}
**<div class="swiper-slide" data-background="{% static 'images/slide01.jpg' %}"> **
<div class="slide-inner">
{% thumbnail new.image_1 "1280x720" crop="center" upscale=True as im %}
<figure><img src="{ im.url} " alt="Image"></figure>
{% endthumbnail %}
<h2>{{ new.text|truncatechars:120 }}</h2>
<div class="link">
<a href="{ blog_single new.id} ">SEE CASE STUDY</a>
</div>
<!-- end link -->
</div>
<!-- end slide-inner -->
</div>
<!-- end swiper-slide -->
{% endfor %}
<!-- end swiper-slide -->
</div>