how to reverse the URL of a ViewSet’s custom action in django restframework July 8, 2023 by Tarik You can use reverse just add to viewset’s basename action: reverse('myuser-gender') See related part of docs.