如何在 Django CRUD 中自定义 auth.User 管理页面?

2022-01-25 00:00:00 python django django-admin django-users

问题描述

I just want to add the subscription date in the User list in the Django CRUD Administration site. How can I do that ?

Thank you for your help

解决方案

I finally did like this in my admin.py file :

from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User

UserAdmin.list_display = ('email', 'first_name', 'last_name', 'is_active', 'date_joined', 'is_staff')

admin.site.unregister(User)
admin.site.register(User, UserAdmin)

相关文章