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

前端 未结 9 1471
梦如初夏
梦如初夏 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:36

    This is the command i used, just in case you are having problem in that throw AttributeError: Manager isn't available; 'auth.User' has been swapped for 'users.User'.

    python manage.py shell -c "from django.contrib.auth import get_user_model; 
    User = get_user_model(); 
    u = User.objects.get(username='admin'); 
    u.set_password('password123');
    u.save()"
    

提交回复
热议问题