I read this and my code looked like this:
html:
<li {% if request.path == '/groups/{{ group.id }}/' %}class="active"{% endif %} ><a href="{% url 'detail' group.id %}">Link</a></li>
The only problem is that /groups/{{ group.id }}/
obviously turn into:
/groups/{{ group.id }}/
not
/groups/1/
that will end up being a lot of code if type it for the other 10 links on the page.