      """
      The default authorization token model.
      """
      key = models.CharField(max_length=40, primary_key=True)
      user = models.OneToOneField('auth.User', 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()
 
</s>
    user = models.OneToOneField(user_model, related_name='auth_token')
      """
      The default authorization token model.
      """
      key = models.CharField(max_length=40, primary_key=True)
    user = models.OneToOneField(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()
keep keep keep keep replace keep keep keep keep keep
 Django 1.5 support, and awareness for AUTH_USER_MODEL
rest_framework/authtoken/models.py