Changing password in Django Admin

前端 未结 7 1719
一个人的身影
一个人的身影 2020-12-14 19:49

I recently created the admin.py based in the Django Project Document:

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#django.contrib.auth.models

7条回答
  •  萌比男神i
    2020-12-14 20:08

    You could also consider extending the UserAdmin this way:

    from django.contrib import admin
    from myapp.models import CustomUser
    from django.contrib.auth.admin import UserAdmin
    
    class CustomUserAdmin(UserAdmin):
        list_display = []
    admin.site.register(CustomUser, CustomUserAdmin)
    

提交回复
热议问题