[Django]-Django – Adding {% url %} in template with slug

9👍

✅

You need to pass the slug into the url tag in the html.

Try something like this,

<a href="{% url 'update' slug=instance.slug %}"> Edit </a>
<a href="{% url 'delete' slug=instance.slug %}"> Delete</a> 

Leave a comment