[Python] django problem, when I pass product id by get method

Discussão em 'Python' iniciado por Stack, Junho 1, 2025.

  1. Stack

    Stack Membro Participativo

    In href tag I want to send product id but this code showing an error.

    Could not parse the remainder: 'data.id' from ''viewproduct'data.id'

    {% for data in data %}

    <div class="item mt-5">

    <div class="card" >

    **<a href={% url 'viewproduct'data.id %}>**

    <img class="women" src="{{data.image.url}} "alt="First slide">
    </div>
    <div class="card-body text-center">
    <h4>{{data.name}}</h4>

    </div></a>
    </div>


    {% endfor %}

    Continue reading...

Compartilhe esta Página