1👍
Try something like this:
class SomeViewSet(viewsets.ViewSet):
def create(self, request):
pass
@action(detail=True, methods=["PUT"], url_name="custom_action")
def custom_action(self, request):
pass
Source:stackexchange.com