Python django.contrib.auth.models 模块,BaseUserManager() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用django.contrib.auth.models.BaseUserManager()

项目:pontifex-project    作者:PontifexProject    | 项目源码 | 文件源码
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