There are instances where you want to get the information from django user model to the extended profile serializer. Django doesn’t not come with a ready to use solution but its not hard to make one.


class UserAccountSerializer(serializers.ModelSerializer):
  id = serializers.IntegerField(source = 'pk', read_only = True)
  username = serializers.CharField(source = 'user.username', read_only = True)
  email = serializers.CharField(source = 'user.email')
  first_name = serializers.CharField(source = 'user.first_name')
  last_name = serializers.CharField(source = 'user.last_name')

It works by defining a field in serializer and using the source from user object of logged in user.