  from rest_framework.authtoken.models import Token
  from rest_framework.authtoken.serializers import AuthTokenSerializer
  from django.http import HttpResponse
  
  class AuthTokenLoginView(CreateAPIView):
      model = Token
      serializer_class = AuthTokenSerializer
  
  
  class AuthTokenLogoutView(APIView):
 
</s> remove from django.http import HttpResponse
 </s> add  </s> remove     serializer_class = AuthTokenSerializer
 </s> add  </s> remove 
class AuthTokenLogoutView(APIView):
 </s> add  </s> remove from rest_framework.generics import CreateAPIView
 </s> add from rest_framework import status
from rest_framework import parsers
from rest_framework import renderers
from rest_framework.response import Response </s> remove     token = serializers.Field(source="key")
    username = serializers.CharField(max_length=30)
 </s> add     username = serializers.CharField()
class AuthTokenView(APIView):
    throttle_classes = ()
    permission_classes = ()
    parser_classes = (parsers.FormParser, parsers.MultiPartParser, parsers.JSONParser,)
    renderer_classes = (renderers.JSONRenderer,) 
  from rest_framework.authtoken.models import Token
  from rest_framework.authtoken.serializers import AuthTokenSerializer
  from django.http import HttpResponse
  
class AuthTokenView(APIView):
    throttle_classes = ()
    permission_classes = ()
    parser_classes = (parsers.FormParser, parsers.MultiPartParser, parsers.JSONParser,)
    renderer_classes = (renderers.JSONRenderer,) 
      model = Token
      serializer_class = AuthTokenSerializer
  
  
  class AuthTokenLogoutView(APIView):
keep keep keep keep replace keep keep keep keep keep
 Updates to login view for TokenAuthentication from feedback from Tom 
rest_framework/authtoken/views.py