I'm working on a django project.
I'm wondering how to get GET parameters in template so that I can make corresponding tab active.
I tried the code below, but it didn't work.
<a class="list-group-item {% if '?q=' in request.path %}active{% endif %}" href="{% url 'blah'%}"> Foo </a>
Thank you in advance.
Get it in
viewand send it as parameter inrenderand use it in template
Or get it as
and set in template without
ifBTW:
You could get it also as
and use it in template to set class and to display query