[Django]-NoReverseMatch at / Python Django

6👍

From “Features to be removed in 1.10”:

  • The ability to reverse() URLs using a dotted Python path is removed.

The {% url %} tag uses reverse(), so the same applies. As elethan mentioned in the comments, you need to use the name parameter provided in your URLconf instead, in this case views.product_detail:

{% for pr in product %}
            <li>
                <a href="{% url 'views.product_detail' pr.pk %}">{{ pr.name }} </a>
                | {{ pr.description }}
                <img src="{{ pr.imagen.url }}" alt="">
            </li>
{% endfor %}
👤knbk

Leave a comment