AttributeError 'tuple' object has no attribute 'values' django rest framework
Your serializer needs to use a nested Meta
class to declare model
and fields
(you were declaring them as normal attributes of the class instead of nesting them):
class SiteInfoSerializer(serializers.ModelSerializer):
class Meta:
model = SiteInfo
fields = ('site_id', 'site_name', 'latitude', 'longitude')
by adding (class Meta) in serializers.py the error can get solved as per my error which i were getting.
the image which shows code of serializers.py