How to allow users to change their own passwords in Django?

前端 未结 9 1374
梦如初夏
梦如初夏 2021-01-30 03:57

Can any one point me to code where users can change their own passwords in Django?

9条回答
  •  隐瞒了意图╮
    2021-01-30 04:15

    Its without need to go to shell enter passwd and reenter passwd

     python manage.py changepassword  
      or
    /manage.py changepassword 
    

    Using shell

    python manage.py shell
    from django.contrib.auth.models import User
    users=User.objects.filter(email='') 
      #you can user username or etc to get users query set
      #you can also use get method to get users
    user=users[0]
    user.set_password('__enter passwd__')
    user.save()
    exit()
    

提交回复
热议问题