[Answered ]-Unable to filter using django-filters

1👍

You should filter with:

?brand__name__iexact=mybrand

It however is probably better to make a dedicated field, like:

from django_filters import CharFilter


class ProductFilter(FilterSet):
    brand = CharFilter(field_name='brand__name', lookup_expr='iexact')

    class Meta:
        model = Product
        fields = {}

then you filter with:

?brand=mybrand

Leave a comment