          url(r'^auth-token', include('rest_framework.authtoken.urls', namespace='rest_framework'))
      )
  """
  from django.conf.urls.defaults import patterns, url
  from rest_framework.authtoken.views import AuthTokenLoginView, AuthTokenLogoutView
  
  urlpatterns = patterns('rest_framework.authtoken.views',
      url(r'^login/$', AuthTokenLoginView.as_view(), name='token_login'),
      url(r'^logout/$', AuthTokenLogoutView.as_view(), name='token_logout'),
  )
 
</s> remove     url(r'^login/$', AuthTokenLoginView.as_view(), name='token_login'),
    url(r'^logout/$', AuthTokenLogoutView.as_view(), name='token_logout'),
 </s> add     url(r'^login/$', AuthTokenView.as_view(), name='token_login'), </s> remove     token = serializers.Field(source="key")
    username = serializers.CharField(max_length=30)
 </s> add     username = serializers.CharField() </s> remove class AuthTokenLoginView(CreateAPIView):
 </s> add class AuthTokenView(APIView):
    throttle_classes = ()
    permission_classes = ()
    parser_classes = (parsers.FormParser, parsers.MultiPartParser, parsers.JSONParser,)
    renderer_classes = (renderers.JSONRenderer,)  </s> remove from rest_framework.authtoken.models import Token

 </s> add  </s> remove     def convert_object(self, obj):
        ret = self._dict_class()
        ret['token'] = obj.key
        ret['user'] = obj.user.id
        return ret

    def restore_object(self, attrs, instance=None):
        token, created = Token.objects.get_or_create(user=attrs['user'])
        return token
 </s> add 
from rest_framework.authtoken.views import AuthTokenView
          url(r'^auth-token', include('rest_framework.authtoken.urls', namespace='rest_framework'))
      )
  """
  from django.conf.urls.defaults import patterns, url
from rest_framework.authtoken.views import AuthTokenView
  
  urlpatterns = patterns('rest_framework.authtoken.views',
      url(r'^login/$', AuthTokenLoginView.as_view(), name='token_login'),
      url(r'^logout/$', AuthTokenLogoutView.as_view(), name='token_logout'),
  )
keep keep keep keep replace keep keep keep keep keep
 Updates to login view for TokenAuthentication from feedback from Tom 
rest_framework/authtoken/urls.py