Answer the question
In order to leave comments, you need to log in
How to move a template out of a loop into a separate file in Django?
Welcome all.
I have loops like this in different places:
{% for object in object_list %}
<h1>object.title</h1>
{% endfor %}
<h1>object.title</h1>
Answer the question
In order to leave comments, you need to log in
It is possible through include
{% include 'componentns/sweetallerts.html' %}
<h1>object.title</h1>
How to include item_in_loop.html in any template?
How to pass an object from the loop to item_in_loop.html?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question