我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用django.contrib.auth.models.BaseUserManager()。
def _reset_password(self, user): """ Generate and reset a user's password. """ new_password = BaseUserManager().make_random_password(length=15) user.set_password(new_password) # NB: not saving until successful completion of email being sent return new_password