ARJhe / Django_tutorial-Blog

0 stars 0 forks source link

Forgot User's password #3

Open ARJhe opened 4 years ago

ARJhe commented 4 years ago
python manage.py shell

from django.contrib.auth.models import User

# reset password
user = User.objects.get(username='root') user.set_password('newpassword')
user.save()

# list superuser
User.objects.filter(is_superuser=True)

# list all user
User.objects.all()