title: Returning many objects on html page - Django 2.0
body: <p>I am returning the "comentarios" objects of the database through a for, but since the display of these objects takes up a lot of space in the html page, I would like to know how to divide the objects into more lists or into a hidden space, since when they pass from seven comments they exceed the size of the body.</p>
  
  <p>template.html </p>
  
  <pre><code>{% extends 'baseR.html' %}
  {% load static %}
  {% block title %} Comentários - SMILE 3D {% endblock %}
  {% block tamanho %} 2000px {% endblock %}
  {% load bootstrap %}
  
  {% block main %}
  
  &lt;div class="row b2"&gt;
       &lt;div class="col-1"&gt;&lt;/div&gt;
       &lt;div class="col-10"&gt;
              &lt;h3 style="color:royalblue; font-weight:bold;"&gt;Pregão: &lt;/h3&gt;
  
           &lt;hr&gt;
           &lt;h2&gt;{{msg}}&lt;/h2&gt;
           &lt;br&gt;
           &lt;ul style="list-sytle:none;"&gt;
               &lt;div class="container pregoes"&gt;
  
                  &lt;li style="list-style:none;"&gt;
                      &lt;p&gt;&lt;strong&gt;Dono: &lt;/strong&gt;&lt;a href="{% url 'perfil-geral' pregoe.usuario.id %}" class="cNome"&gt;{{pregoe.usuario}}&lt;/a&gt;&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Tipo do pregão: &lt;/strong&gt;{{ pregoe.tipo }}&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Dente: &lt;/strong&gt;{{ pregoe.dente }}&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Cor: &lt;/strong&gt;{{ pregoe.cor }}&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Escala: &lt;/strong&gt;{{ pregoe.escala }}&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Material: &lt;/strong&gt;{{ pregoe.material }}&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Observações: &lt;/strong&gt;{{ pregoe.extra }}&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Preço inicial: &lt;/strong&gt;R${{ pregoe.preco }}&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Data de registro: &lt;/strong&gt;&lt;em&gt;{{ pregoe.data }}&lt;/em&gt;&lt;/p&gt;
                      &lt;p&gt;&lt;strong&gt;Prazo: &lt;/strong&gt;&lt;em&gt;{{ pregoe.prazo }}&lt;/em&gt;&lt;/p&gt;
                  &lt;/li&gt;
               &lt;/div&gt;
               &lt;br&gt;
               &lt;hr&gt;
               **&lt;h3&gt;Comentários: &lt;/h3&gt;
               {% for comentario in comentarios %}
                   &lt;div class="container" style="background-color:gainsboro; padding-bottom:2px; padding-top:10px;"&gt;
                           &lt;a href="{% url 'delete-comentario' comentario.id %}"&gt;&lt;i class="far fa-times-circle" style="float: right;"&gt;&lt;/i&gt;&lt;/a&gt;
                           &lt;a href="{% url 'perfil-geral' comentario.user.id %}" class="cNome"&gt; &lt;p&gt;&lt;strong&gt;{{comentario.user}}&lt;/strong&gt; &lt;/p&gt;&lt;/a&gt;
                           &lt;p style="float:right;"&gt;{{comentario.comentario}}&lt;/p&gt;
  
                       &lt;div class="circle1"&gt;
                           &lt;a href="{% url 'perfil-geral' comentario.user.id %}"&gt;&lt;img src="../../media/{{comentario.user.foto}}" class="fotoPerfil img-fluid" style="max-width: 80px;"&gt;&lt;/a&gt;
                       &lt;/div&gt;
                   &lt;/div&gt;
                   &lt;br&gt;
               {% endfor %}**
               &lt;br&gt;
               {{msg}}
  
               &lt;a href="{% url 'novo-comentario' pregoe.id user.id %}" style="float:right; margin-top:-20px; margin-left:8px;"&gt;  NOVO COMENTÁRIO  &lt;i class="far fa-comment"&gt;&lt;/i&gt;&lt;/a&gt;
           &lt;/ul&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>@login_required
  def listaComentarios(request, id1, id2):
      user = get_object_or_404(CustomUser, pk=id2)
      pregao = get_object_or_404(Pregao, pk=id1)
      comentarios = Comentario.objects.all().filter(pregao=pregao)
      if user == pregao.usuario:
          return render(request, 'comentarios/lista-comentarios-dono.html', {'comentarios': comentarios, 'pregoe': pregao})
      return render(request, 'comentarios/lista-comentarios.html', {'comentarios': comentarios, 'pregoe': pregao})
  </code></pre>