0

{% for j in range(0,10) %}
                 <div class="titre">
                   <h3>{{ titre[j] }} </h3>
                 </div>

                 <div class="resume">
                     <p> The background-image is repeated as much as possible without clipping.
                         The first and last image is pinned to either side of the element, and whitespace is distributed evenly between the images</p>
                 </div>

                 <div class="date">
                     <p><span style="font-style: italic;font-weight: bold;">date de publication</span>
                         {{ date[j] }} </p>
                 </div>
             {% endfor %}

I have a problem with my template especially at the {% for j in range(0,10) %}. I don't understand it sends the error Could not parse the remainder: '(0,10)' from 'range(0,10) here is the error code and message it displays at the bottom

MAYI tech
  • 1
  • 1
  • 1
    It's because writing Django template is not the same as writing Python. Maybe this could help you solving your problem? https://stackoverflow.com/questions/1107737/numeric-for-loop-in-django-templates – jkoestinger Mar 16 '22 at 13:28
  • This is a numerical loop in Django which uses python syntax in parts: https://pythonguides.com/django-for-loop/ – D.L Mar 16 '22 at 16:33

1 Answers1

0

thanks for all guys. I found that django doesn't support range(10) and I replaced that part of the code with that {% for j in '0123456789'|make_list %}. and it works very well thanks for links

MAYI tech
  • 1
  • 1