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

355
Vistas
Django for loop to display all objects in database
def homepage(response):
    data = Project_types.objects.all()
    return render(response, 'main/homepage.html',{'projects':data})


def hacks(response):
    return render(response, 'main/hacks.html', {})

def games(response):
    return render(response, 'main/games.html', {})

All I need to know is how to iterate through each object in the variable "data" in html. I want it displayed in the most simple way possible !

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Using the FOR template tags you can iterate through the objects in the data list ...

templatename.html:

{% for iteratorname in projects %}
    <h1> {{ iteratorname.attributes }} </h1>
{% endfor %}

Please read the documentation for more details

over 4 years ago · Santiago Trujillo Denunciar

0

You can use for template tag:

{% for project in projects %}
    <p> {{project.attributes}} </p>
{% endfor %}
over 4 years ago · Santiago Trujillo 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