1👍
Instead of this:
{% for top in topwear.brand %}
<a href="{% url 'searchproduct' top %}" class="dropdown-item">Top Wear</a>
{% endfor %}
try this:
{% for top in topwear %}
<a href="{% url 'searchproduct' top.brand %}" class="dropdown-item">Top Wear</a>
{% endfor %}
Source:stackexchange.com