[Django]-Adding a search field for Token section in Django Admin

4👍

Try this

admin.py:

from rest_framework.authtoken.models import Token

class FilterTokenAdmin(admin.ModelAdmin):
    search_fields = ['user__email','user__username']
admin.site.register(Token,FilterTokenAdmin)

Leave a comment