I'm trying to print my products from sqlite the problem is that the result in the browser is the code itself and not the value.
views.py:
from django.shortcuts import render
from django.http import HttpResponse
from .models import Product
def index(request):
products = Product.objects.all()
return render(request, 'index.html', {'dict': products})
index.html:
<ul>
{% for prod in dict %}
<li>{{ prod.name }}</li>
{% endfor %}
</ul>
The result in the browser is:
{% for prod in dict %}
{{ prod.name }}
{% endfor %}