title: IntegrityError - Column cannot be null DJANGO
body: <p>Everything works good in views and templates. When Ive made serializer and then APIVIew something wrong happend. GET method is ok, but POST is not. When I try to add food I get IntegrityError like this: (but in admin panel and GUI you can add food normally so its not problem with model the problem must be with serializer)</p>
  
  <blockquote>
    <p>IntegrityError at /food_list_serializer/</p>
    
    <p>Column 'kcal' cannot be null</p>
  </blockquote>
  
  <p>MODEL look like this:</p>
  
  <pre><code>class Food(models.Model):
      name = models.CharField(max_length=124)
      kcal = models.FloatField()
      proteins = models.FloatField()
      carbs = models.FloatField()
      fats = models.FloatField()
      grams = models.FloatField(default=100, validators=[MinValueValidator(1)])
  </code></pre>
  
  <p>SERIALIZER:</p>
  
  <pre><code>class FoodSerializer(serializers.ModelSerializer):
      class Meta:
          model = Food
          fields = '__all__'
  </code></pre>
  
  <p>VIEWS:</p>
  
  <pre><code>class FoodListSerializer(APIView):
      def get(self, request, format=None):
          food = Food.objects.all()
          serializer = FoodSerializer(food, many=True, context={'request': request})
          return Response(serializer.data)
  
      def post(self, request):
          food_create = Food.objects.create()
          serializer = FoodSerializer(food_create, data=request.data)
          if serializer.is_valid():
              serializer.save()
              return Response(serializer.data)
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Gyqyw.png" rel="nofollow noreferrer">POST request in DJANGO rest framework looks like this</a></p>