[Answer]-Using rest django rest framework for creating new object

1đź‘Ť

âś…

In your serializer, you’ve set the customer key to read_only:

customer = serializers.PrimaryKeyRelatedField(read_only=True)

Try setting it to False or just simply removing this whole line (which seems superfluous to me)

Leave a comment