title: Unable to do PUT operation -DjangoRESTFramework
body: <p><strong>I am unable to do <em>PUT</em> operation in Django rest framework</strong>, I am able to GET, POST, DELETE operation.</p>
  
  <p>This is the error <a href="https://i.stack.imgur.com/z9y1e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z9y1e.png" alt="Image"></a>
  I have tried using @api_view but there also its not,
  I mostly refer the <a href="http://www.django-rest-framework.org/" rel="nofollow noreferrer">djangorestframework</a> website</p>
  
  <p>Below is my code:</p>
  
  <p><em>serializers.py</em></p>
  
  <pre><code>from rest_framework import serializers
  from snippets.models import Snippet
  #from django.contrib.auth.models import *
  
  class SnippetSerializer(serializers.ModelSerializer):
              class Meta:
                  model = Snippet
                  fields = ('id','title','code')
  </code></pre>
  
  <p><em>Models.py</em></p>
  
  <pre><code>from __future__ import unicode_literals
  from django.db import models
  
  # Create your models here.
  
  
  class Snippet(models.Model):
      created = models.DateTimeField(auto_now_add=True)
      title = models.CharField(max_length=100, blank=True, default='')
      code = models.CharField(max_length=100, blank=True, default='')
  
  
  class Meta:
      ordering = ('created',)
  </code></pre>
  
  <p><em>Views.py</em></p>
  
  <pre><code>from rest_framework import viewsets
  from rest_framework.decorators import api_view
  from snippets.serializers import SnippetSerializer
  
      class SnippetViewSet(viewsets.ModelViewSet):
          """
          API endpoint that allows users to be viewed or edited.
          """
          queryset = Snippet.objects.all().order_by('id')
          serializer_class = SnippetSerializer
  </code></pre>
  
  <p><em>urls.py</em></p>
  
  <pre><code>rom django.conf.urls import url, include
  from rest_framework import routers
  from django.contrib import admin
  from snippets import views
  
  
  
  
  router = routers.DefaultRouter()
  router.register(r'snippet', views.SnippetViewSet)
  
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^', include(router.urls)),
      url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
  
  ]
  </code></pre>