Django Admin Not Hashing Custom User Password

前端 未结 3 2093
情深已故
情深已故 2021-02-05 03:44
  • Python 3
  • Django 1.5
  • PostgreSQL 5.0.3

I\'m new to Django & I\'m making a Django app that makes use of AbstractUser, but when I create

3条回答
  •  一个人的身影
    2021-02-05 03:50

    I guess the problem is that you inherited ModelAdmin instead of UserAdmin from django.contrib.auth.admin in your admin.py.

    Sample code:

    from django.contrib.auth.admin import UserAdmin
    from .models import Employee
    
    class EmployeeAdmin(UserAdmin):
        pass
    
    admin.site.register(Employee, EmployeeAdmin)
    

提交回复
热议问题