Answer the question
In order to leave comments, you need to log in
Why is html block not rendered in django?
Hello, the output of html blocks is not working, please help))
{% if latest_arlicles_list %}
{% for a in latest_arlicles_list %}
<div class="card">
<div class="card-2">
<div class="image"><img src="{% url 'a.book_image' %}" alt="" class="image"></div>
<div class="title">{{ a.book_title }}</div>
<div class="button"><a href="{% url 'a.book_link' %}" class="download">Посмотреть</a></div>
</div>
</div>
{% endfor %}
{% else %}
Книги не найдены((((
{% endif %}
from django.shortcuts import render
from .models import Book
import os
def index(request):
latest_arlticles_list = Book.objects.all()
return render(request, 'book/list.html', {'latest_arlticles_list': latest_arlticles_list})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question