7👍
Your code may work if you set the password to None
but it’s good practice to use set_unusable_password
.
Users with an unusable password are not allowed to request a password reset. If you had the ModelBackend
and LDAP backends enabled, then a user with password=None
could reset their password and then log in with the model backend.
Source:stackexchange.com