Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
How can I load specific number of items in Django and then load more items after scrolling?

I added some products with using this function in my views:

def All( request  ):
    p=product.objects.all()
    return render(request,'home.html',{'p':p})

And my template looks like this:

<div class="grid">  
  
         {%for p in p%} 
                <div class='card'>
                    <img src="{{p.image}}"></img>
                    <p id="id">{{p.description}}</p>
                    <a href="{{p.buy}}" target='_blank' rel='noopener noreferrer'>
                        <button ><span class="price"> ${{p.price}}</span> buy</button>
                    </a>    




                </div>

         {%endfor%} 

But I do not know what should I do to be able to limit the products, for example I want to have 10 products after the page is loaded and then after scrolling I want 10 more products to appear.

How can I do that?

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

You need to use pagination you can read about it here in the docs

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda