Django Rest Framework :How to serialize many to many field

Solution 1:

You forget to set many=True in certificates = CertificatesSerializer()

Correct version:

class SuppliersSerializer(serializers.ModelSerializer):
    certificates = CertificatesSerializer(many=True)

    class Meta:
        model = Suppliers
        fields = ('id', 'name', 'certificates')

Witout that DRF think this is one to one relation instead of one to many