[Answered ]-How to hide the Token model from rest_framework.authtoken in django admin panel

2๐Ÿ‘

I faced the same problem with Django==4.0.4 and djangorestframework==3.13.1. I had new Django project with DRF and even though I did not register the model Token it was showing up on the admin site.

When I click the Token link in the admin, it was redirect me to /admin/authtoken/tokenproxy/. So, instead of the Token model, unregister the TokenProxy model from admin site;

from rest_framework.authtoken.models import TokenProxy

admin.site.unregister(TokenProxy)

This solved my problem.

๐Ÿ‘คuedemir

-1๐Ÿ‘

You have to remove rest_framework.authtoken from INSTALLED_APPS

๐Ÿ‘คFacuZ3

Leave a comment