Skip to content Skip to sidebar Skip to footer

Error Http Status Code Must Be An Integer,

I'm trying to serialize my views, and I get this error about http status code must be an integer, I don't see where is the data that must be integer and is passed as string. I will

Solution 1:

You're passing four separate dictionaries to Response here. You should pass a single one:

return Response(
  {
    'place_list': PlaceSerializer(place_list,many=True).data, 
    'place_order': PlaceSerializer(place_order,many=True).data, 
    'disliked_list': PlaceSerializer(disliked_list,many=True).data,  
    'preferred_list': PlaceSerializer(preferred_list,many=True).data
  }
)

Solution 2:

place_list = user.disliked.all()
respose=PlaceSerializer(place_list,many=True)\
return Response(response.data,status=status.HTTP_200_OK)

Post a Comment for "Error Http Status Code Must Be An Integer,"