How to return single object in django GET api (rest framework)

django, django-models, django-rest-framework, django-views, python

Solution

 m = Configuration.objects.get(id=1) # you need to get single object here
 serializer = ConfigurationSerializer(m) # remove many = True

Problem

I have a Table "Configuration". ``` class Configuration(models.Model): inventory_check = models.BooleanField(default=False) refund = models.BooleanField(default=False) record_seat_number = models.BooleanField(default=False) base_url = models.URLField() ``` This table will have a single entry. Below is the serializer : ``` class ConfigurationSerializer(serializers.ModelSerializer): class Meta: model = Configuration fields = '__all__' ``` I am using rest framework for the API. Below is the Views.py ``` @api_view(['GET']) def get_configuration(request): m = Configuration.objects.all() serializer = ConfigurationSerializer(m, many=True) return Response(serializer.data, status=status.HTTP_200_OK) ``` This works perfectly. But the problem is this would return object inside array. ``` [ { "id": 1, "inventory_check": false, "refund": true, "record_seat_number": false, "base_url": "http://localhost:8000/" } ] ``` All I want is to send only the object without array. How to achieve this?

Original source