title: Delete method on Django Rest Framework ModelViewSet
body: <p>i have tried to delete a single ManuscriptItem instance using Postman to perform my API requests on against the view below:</p>
  
  <pre><code>class ManuscriptViewSet(viewsets.ModelViewSet):
      """Handles creating, reading and updating items."""
  
      authentication_classes = (TokenAuthentication,)
      serializer_class = serializers.ManuscriptItemSerializer
      permission_classes = (permissions.PostOwnManuscript, IsAuthenticated,)
  
      def perform_create(self, serializer):
          """Sets the user profile to the logged in user."""
          serializer.save(author=self.request.user)
  
      def get_queryset(self):
          """
          This view should return a list of all the manuscripts
          for the currently authenticated user.
          """
          user = self.request.user
          return models.ManuscriptItem.objects.filter(author=user)
  
      def destroy(self, request, *args, **kwargs):
          instance = self.get_object()
          self.perform_destroy(instance)
          return Response(status=status.HTTP_204_NO_CONTENT)
  
      def perform_destroy(self, instance):
          instance.delete()
  </code></pre>
  
  <p>The destroy and perform destroy functions are what I have attempted without success. This is what it returns when i tried:</p>
  
  <blockquote>
    <p>{
        "detail": "Method \"DELETE\" not allowed." }</p>
  </blockquote>
  
  <p>This is how my URLs are currently registered:</p>
  
  <pre><code>router = DefaultRouter()
  router.register('manuscripts', views.ManuscriptViewSet, base_name="manuscripts")  # auto basename for models
  router.register('manuscriptlibrary', views.ManuscriptLibraryViewSet, base_name="manuscript_library")
  router.register('manuscriptsettings', views.ManuscriptSettingsViewSet)
  
  
  urlpatterns = [
      url(r'', include(router.urls))
  ]
  </code></pre>
  
  <p>I'm i modifying the ModelViewSet wrong do i need to use another approach because of the nature of ModelViewSet? i expected it to work on Postman when i used an Authorized user to Delete a ManuscriptItem instance. In the docs it said Destroy() method can be used.</p>
  
  <p><strong>Additional information</strong></p>
  
  <p>The URL used is:</p>
  
  <blockquote>
    <p><a href="http://localhost:8000/manuscripts-api/manuscripts/" rel="noreferrer">http://localhost:8000/manuscripts-api/manuscripts/</a></p>
  </blockquote>
  
  <p>The model instance to be deleted from:</p>
  
  <pre><code>class ManuscriptItem(models.Model):
      """Represents a single manuscript's content"""
  
      author = models.ForeignKey('accounts_api.UserProfile', on_delete=models.CASCADE)
      title = models.CharField(max_length=255)
      content = models.CharField(max_length=99999999)
  
      def __str__(self):
          """Django uses when it needs to convert the object to a string"""
          return str(self.id)
  </code></pre>
  
  <p>The way i have tried sending delete requests on postman with json:</p>
  
  <blockquote>
  <pre><code>{
      "manuscript": 7,
  }
  </code></pre>
  </blockquote>
  
  <p><strong>Results:</strong> Delete Method not allowed</p>
  
  <blockquote>
  <pre><code>{
      "id": 7,
      "author": 5,
      "title": "niceone",
      "content": "niceone"
  }
  </code></pre>
  </blockquote>
  
  <p><strong>Results:</strong> Delete Method not allowed</p>
  
  <p>Additional Questions/Info:</p>
  
  <p>Don't i need to specify the router register with a pk? I tried this but didnt work either:</p>
  
  <pre><code>router.register('manuscripts/{pk}/$', views.ManuscriptViewSet, base_name="manuscript_detail")
  </code></pre>
  
  <p>Postman says:</p>
  
  <blockquote>
    <p>Allow →GET, POST, HEAD, OPTIONS</p>
  </blockquote>