      key = models.CharField(max_length=40, primary_key=True)
      user = models.OneToOneField(AUTH_USER_MODEL, related_name='auth_token')
      created = models.DateTimeField(auto_now_add=True)
  
      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
  
      def save(self, *args, **kwargs):
          if not self.key:
              self.key = self.generate_key()
          return super(Token, self).save(*args, **kwargs)
  
 
</s> remove             token = self.model.objects.select_related('user').get(key=key)
 </s> add             token = self.get_model().objects.select_related('user').get(key=key) </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 
      key = models.CharField(max_length=40, primary_key=True)
      user = models.OneToOneField(AUTH_USER_MODEL, related_name='auth_token')
      created = models.DateTimeField(auto_now_add=True)
  








      def save(self, *args, **kwargs):
          if not self.key:
              self.key = self.generate_key()
          return super(Token, self).save(*args, **kwargs)
  
keep keep keep keep replace replace replace replace replace replace replace replace keep keep keep keep keep
 don't import authtoken model until needed 
rest_framework/authtoken/models.py