[Django]-How to pass extra parameter to django rest custom action inside the viewset?

5👍

Try this:

    @action(
        detail=True, 
        methods=['get'], 
        url_path=r'password-reset/(?P<uid64>\w+)/(?P<token>\w+)', 
        url_name='password-reset-confirm'
    )
    def password_reset(self, request, pk, uid64, token):
        pass

You will have to capture the three parameters: pk, uid64, and token

Leave a comment