          return self.authenticate_credentials(token)
  
      def authenticate_credentials(self, key):
          try:
              token = self.model.objects.select_related('user').get(key=key)
          except self.model.DoesNotExist:
              raise exceptions.AuthenticationFailed(_('Invalid token.'))
  
          if not token.user.is_active:
              raise exceptions.AuthenticationFailed(_('User inactive or deleted.'))
 
</s> remove     class Meta:
        # Work around for a bug in Django:
        # https://code.djangoproject.com/ticket/19422
        #
        # Also see corresponding ticket:
        # https://github.com/tomchristie/django-rest-framework/issues/705
        abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS

 </s> add  </s> remove     model = Token
 </s> add     model = None

    def get_model(self):
        if self.model is not None:
            return self.model
        from rest_framework.authtoken.models import Token
        return Token
 </s> remove from rest_framework.authtoken.models import Token
 </s> add 
            token = self.get_model().objects.select_related('user').get(key=key)
          return self.authenticate_credentials(token)
  
      def authenticate_credentials(self, key):
          try:
            token = self.get_model().objects.select_related('user').get(key=key)
          except self.model.DoesNotExist:
              raise exceptions.AuthenticationFailed(_('Invalid token.'))
  
          if not token.user.is_active:
              raise exceptions.AuthenticationFailed(_('User inactive or deleted.'))
keep keep keep keep replace keep keep keep keep keep
 don't import authtoken model until needed 
rest_framework/authentication.py