Do you need the whole ViewSet
or will a normal GenericView
be sufficient? You could use the CreateAPIView
.
Example:
class FooCreate(generics.CreateAPIView):
Model = Foo
serializer_class = FooSerializer
EDIT:
If you do need to use a ViewSet
, you could create a custom Router that will only handle post
requests. Documentation here, including a read-only (i.e. get
) example.