[Fixed]-How to attach a ForeignKey value in an APIView?

1👍

In my opinion most suitable approach for you is override perform_create method.

class CreateModel(generics.CreateAPIView):

    def perform_create(self, serializer):
        serializer.save(owner=self.request.user)

Leave a comment