***************************************************
views.py
from rest_framework import generics,permissions
class NotifyDestroy(generics.DestroyAPIView):
    """delete current user """
    permission_classes=[permissions.IsAuthenticated]
    serializer_class=user_delete_ser
    queryset=User.objects.all()  

*********************************************
serializers.py

from rest_framework.serializers import ModelSerializer
class user_setting_ser(ModelSerializer):
    class Meta:
        model=User
        fields=['id']


****************************************
urls.py
path('delete_user/<int:pk>',NotifyDestroy.as_view(),name='delete-current-user'),
 

> *********************************

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/22fd723f-a07b-4fe1-9f70-80c23e1dcd38n%40googlegroups.com.

Reply via email to