[Django]-NoReverseMatch at / Reverse for 'single_product' with no arguments not found. 1 pattern(s) tried: ['products/(?P<slug>)/$']

7👍

you are not passing the slug in the url but have given a parameter to your pattern.

so change the html

<a href ="{% url 'products:single_product' product.slug %}" class = "btn btn-primary" role = "button">
      View Product
   </a>

Leave a comment