Why for loop is not running in django template?

for loop is not running in django template.

from .models import * 

def product(request):
    prod = productX.objects.all()
    for i in prod:
        print(i.name,": $",i.price)
    return render(request , 'account/product.html',{prod : "prod"})

<table class="table">
            <tr>
                <th>Product</th>
                <th>Catagery</th>
                <th>Price</th>
            </tr>
            <tr>
                {% for i in prod %}
                <td>{{i.name}}</td>
                <td>{{i.category}}</td>
                <td>${{i.price}}</td>
                {% endfor %}
            </tr>
        </table>

For loop is working in terminal but showing nothing in the template..

the problem is on showing objects, first you have to put for above tr tag


    {% for i in prod %}
        <tr>
            <td>...</td>
        </tr>
    {% endfor %}

then the objects will be show in template
at the end be sure that you have installed jinja

Back to Top