class UserViewSet(viewsets.ViewSet):
    """Userviewset
    Restful Structure:
        | URL style      | HTTP Method | URL Nanme   | Action Function |
        |----------------|-------------|-------------|-----------------|
        | /users         | GET, POST   | user-list   | user_list       |
        | /users/<email> | GET, DELETE | user-detail | user_detail     |
    """
lookup_field = 'email'
lookup_value_regex = '[\\w.%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}'

def list(self, request):
    """GET - Show all users"""
print(request.version)
api_result = user_list.lists_all_users()
return Response(api_result)

def create(self, request):
    """POST - Add new user"""
api_result = user_list.create_new_user(request.data)
return Response(api_result)

def retrieve(self, request, email=None):
    """GET - Show <email> user"""
api_result = user_detail.retrieve_the_user(email)
return Response(api_result)

def partial_update(self, request, email=None):
    return Response()

def destroy(self, request, email=None):
    """DETELE - Delete <email> user"""
api_result = user_detail.destroy_the_user(email)
return Response(api_result)
Django rest framework Router - how to add customized URL and view functions