add primary key to url django code example
Example 1: how to pass primary key to url django
<a href="{% url 'category_detail' pk=post.category.id %}" >{{ post.category }}</a>
Example 2: Django url with primary key
<table>
{% for service in services %}
<tr>
<td>{{ service.services }}
<ul>
<li>Total Requirements Count = {{ service.requirements_set.count }}</li>
<li>Total Verified Count = {{ service.get_verifed_req_count }}</li>
</ul>
</td>
</tr>
{% endfor %}
</table>