Well, the problem is simple. If I post my data via the HTML form, a new record is created in the DB but all data passed is null, as shown in the picture.
However, if a use the "raw_data" interface, everything works just fine:
Code is quite simple:
views.py:
class CollectionList(generics.ListCreateAPIView):
queryset = Collection.objects.all()
serializer_class = CollectionSerializer
serializer.py:
class CollectionSerializer(serializers.ModelSerializer):
class Meta:
model = Collection
fields = ('id','title', 'nlikes')
Any suggestion?