code: def get_api_root_view(self, **kwargs):
          
          class API(views.APIView):
              _ignore_model_permissions = True
  
              def get(self, request, *args, **kwargs):
                  directory_list = get_directory(request)
                  result = OrderedDict()
                  for group_name, url, endpoints, _ in directory_list:
                      if url:
                          result[group_name] = url
                      else:
                          group = OrderedDict()
                          for endpoint_name, url, _, _ in endpoints:
                              group[endpoint_name] = url
                          result[group_name] = group
                  return Response(result)
  
          return API.as_view()
docs: Return API root view, using the global directory.