I am trying to create an API which can return all the countries using django_countries.
I am trying something following but it is not working. As an individual field, it works fine but with complete countries list it is giving an error.
from django_countries import countries
class CountrySerializer(serializers.Serializer):
country = serializers.ListField(source=countries)
class Meta:
fields = ("country",)