title: How to use loop for requesting from html template in Django
body: <p>From html template say &quot;createlist&quot; I want to add link which actually request server to get one more object of image form to the &quot;createlist&quot; page. But when I run the code it actually happens only one time but I want maximum of 5 times this should be accepted. So here how I can use loop in html template so that it will get the request again and again up to the limit say 5.
  here is the template code -</p>
  <pre><code>
      {% if morepicform %}
          {{ morepicform }}
      {% endif %}
      Want to add more pics? &lt;a href=&quot;{% url 'createlist' 'morepic' %}&quot; role=&quot;button&quot;&gt;
      &lt;img src=&quot;static/auctions/plus-circle-solid.svg&quot; height=&quot;20px&quot; width=&quot;20px&quot;&gt;&lt;/a&gt;
  
  </code></pre>
  <p>views function</p>
  <pre><code>def morepic(request, morepic=''):
      return render(request, &quot;auctions/createlist.html&quot;,{
          &quot;morepicform&quot; : PictureForm(),
          &quot;picform&quot; : PictureForm(),
          &quot;listform&quot; : ListingForm()
      })
  </code></pre>
  <p>url pattern path function -</p>
  <p><code>path(&quot;createlist/&lt;str:morepic&gt;&quot;, views.morepic, name=&quot;createlist&quot;)</code></p>
  <p>Now how can I add the functionality of requesting &quot;morepicform&quot;?</p>