django-rest-durin
django-rest-durin copied to clipboard
AuthTokenAdmin list_filter is causing performance problems (mostly timeouts)
Our app has ~50k User objects and even more Client objects, and currently, because of AuthTokenAdmin's list_filter, our app times out every time we access the AuthToken list page in Django admin (because the filter lists every single one of these User and Client objects as possible filters). Can AuthTokenAdmin's list_filter be removed?
Hi.
You make a solid point and ideally it should not have been there but I don't know how soon I'll be able to ship a new release with this change. Meanwhile, you should easily be able to override the AuthTokenAdmin
class and customize it as per your need, like so:
from durin.admin import AuthTokenAdmin
from durin.models import AuthToken
class CustomAuthTokenAdmin(AuthTokenAdmin):
list_filter = []
# Unregister the default admin view for AuthToken
admin.site.unregister(AuthToken)
# Register our custom admin view for AuthToken
admin.site.register(AuthToken, CustomAuthTokenAdmin)