Add JsonResponse to Djoser Endpoint auth/token/logout

Hi. I’m new to Djoser. And still fairly new to Django. Hence my question.

How can I add a response message when a user sends a successful post request to the Djoser endpoint auth/token/logout?

Despite many attempts, I have only gotten successful 204 responses. I just want to add something like “successfully logged out”.

I’ve tried writing different views, and including a url path in the urlpatterns list in the file. This is just one of the views I have tried, from among many others:

def logout(self, request):
     queryset = User.objects.filter(Name=self.request.user)
     if queryset.Name == request.user:
         return JsonResponse(status=201, data={'Update:':'You are now logged out'})
   path('auth/token/logout/', views.logout, name="logout"),

I’m assuming that because it’s a Djoser endpoint, I can’t write a standard view for it to do this, am I correct?

Thanks in advance.