What happened is
The problem has occurred. .. From the conclusion, the cause is operation 2.
By the way, you can read more about customizing Users in the following articles. Article by okoppe8
Register UserAdmin in the second argument of admin.site.register ().
admin.py
from django.contrib import admin
from . models import CustomUser
from django.contrib.auth.admin import UserAdmin
)
admin.site.register(CustomUser, UserAdmin)
I created UserAdmin by myself to customize the management screen and registered it as admin of CustomUser model. If this is the case, the password will not be hashed properly and will be registered, resulting in an error during authentication.
admin.py
from django.contrib import admin
from . models import CustomUser
class UserAdmin(admin.ModelAdmin):
list_display = ('username', 'id', )
admin.site.register(CustomUser, UserAdmin)
Stuck Overflow Created User from django custom admin page can't login
Recommended Posts