access django object in html
{% for x in data %}
<h3>{{x.name}}</h3>
<h4>{{x.department}}</h4>
{% endfor %}
5
1
data = model1.objects.all()
return TemplateResponse(request, 'index.html', {'data': data})
Thank you!
1
0
Are there any code examples left?
New code examples in category Html