You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by kevinrenskers March 18, 2024
After updating to DRF 3.15.0 I am now getting the following error when starting my Django server:
<class 'rest_framework.authtoken.admin.TokenAdmin'>: (admin.E039) An admin for model "User" has to be registered to be referenced by TokenAdmin.autocomplete_fields.
I am using a custom AdminSite instance where only the ModelAdmins that I specifically register to it are shown in my admin site. I have not registered TokenAdmin to my AdminSite, because it's not something we want to see in our admin site. I also have a custom User model, but its ModelAdmin is registered with my custom AdminSite.
It seems that DRF can't handle this situation. I guess that it only looks through the default AdminSite for what is registered there? How can I make DRF just ignore the TokenAdmin? I don't want it in our admin site, as we don't use tokens (only sessions).
tatsuya-satake, mdnkv, shangxiao, finally-mauricio, Poacherx and 2 more