I create a new user and specify a password for that user:
user = User(username = username, email = email)
user.set_unusable_password()
user.save()
When this new user tries to reset password, they get an error:
The user account associated with this e-mail address cannot reset the password
set_unusable_passwordsets a value that will never be a valid password hash, and makes the password unchangable by user himself.I think you should generate a complicated password (using
make_random_password) and send a link for reseting password to the user.