Answer the question
In order to leave comments, you need to log in
How to remove padding from the last block on a website in django?
I am designing a site on django and faced an unsolvable problem, as for me.
There are blocks that are created through the django template engine:
{% block categories %}
{% if latest_categories %}
{% for a in latest_categories %}
<div class="catalog_section">
<h2 class="name_category_css"><a href="#" class="link_name_category">{{a.name_category}}</a></h2>
<img class="image_category" src="{{a.img_category.url}}">
</div>
{% endfor %}
{% else %}
Категории не найдены.
{% endif %}
Answer the question
In order to leave comments, you need to log in
Add a conditional expression to the template code that checks that the iteration is the last one.
https://docs.djangoproject.com/en/2.2/ref/template...
forloop.last
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question