  
  from rest_framework.authtoken.models import Token
  
  
  @admin.register(Token)
  class TokenAdmin(admin.ModelAdmin):
      list_display = ('key', 'user', 'created')
      fields = ('user',)
      ordering = ('-created',)
 
</s> remove from rest_framework.authtoken.models import Token
 </s> add from rest_framework.authtoken.models import Token, TokenProxy

User = get_user_model()


class TokenChangeList(ChangeList):
    """Map to matching User id"""
    def url_for_result(self, result):
        pk = result.user.pk
        return reverse('admin:%s_%s_change' % (self.opts.app_label,
                                               self.opts.model_name),
                       args=(quote(pk),),
                       current_app=self.model_admin.admin_site.name)
  
  from rest_framework.authtoken.models import Token
  
  

  class TokenAdmin(admin.ModelAdmin):
      list_display = ('key', 'user', 'created')
      fields = ('user',)
      ordering = ('-created',)
keep keep keep keep replace keep keep keep keep
 Adjusted token admin to map to user ID. (#7341)

Closes #6131.

* Adds a proxy model for Token that uses the user.pk, rather than it's own.
* Adjusts Admin to map back from User ID to token instance. 
rest_framework/authtoken/admin.py