title: In order to allow non-dict objects to be serialized set the safe parameter to False
body: <p>I create realtime chat application using websocket frontend(angular) backend(Django).. i want to store messages in to db(mySql)..when i trying to store message array from angular to django..it give me error like 500 internal server Eroor and In order to allow non-dict objects to be serialized set the safe parameter to False.
  i sending message data in list array.. so what is wrong?</p>
  
  <p>model.py</p>
  
  <pre><code>class msg(models.Model):
      name = models.ForeignKey(User, on_delete=models.CASCADE)
      receiver = models.CharField(max_length=20)
      text = models.CharField(max_length=1200)
      myDate = models.DateTimeField()
  </code></pre>
  
  <p>serializer.py</p>
  
  <pre><code>class MesSerializer(serializers.ModelSerializer):
      name = serializers.SlugRelatedField(many=False, slug_field='name', queryset=User.objects.all())
      receiver = serializers.SlugRelatedField(many=False, slug_field='name', queryset=User.objects.all())
      class Meta:
          model = msg
          fields = '__all__'
  </code></pre>
  
  <p>view.py</p>
  
  <pre><code>class msg_list(APIView):
      def get(self, request, format=None):
          mes = msg.objects.all()
          serializer = MesSerializer(mes, many=True)  # convert into JSON
          return Response(serializer.data)
  
      def post(self, request, formate = None):
          data = JSONParser().parse(request) #type list
          serializer = MesSerializer(data= data, many = True) #type list
          if serializer.is_valid():
              serializer.save()
              return JsonResponse(serializer.data, status=201)
          return JsonResponse(serializer.errors, status=400)
  </code></pre>
  
  <p>and when i open message api:
  <a href="https://i.stack.imgur.com/O4YQX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O4YQX.png" alt="enter image description here"></a></p>