How to allow users to change their own passwords in Django

0 votes
Can any one point me to code where users can change their own passwords in Django?
Aug 17, 2020 in Python by kartik
• 37,490 points
114 views

1 answer to this question.

0 votes

Hello @kartik,

See the Changing passwords section

  1. Navigation to your project where manage.py file lies

  2. $ python manage.py shell

  3. type below scripts :

from django.contrib.auth.models import User
u = User.objects.get(username__exact='john')
u.set_password('new password')
u.save()

You can also use the simple manage.py command:

manage.py changepassword *username*

Just enter the new password twice.

Hope it helps!!
Thank you!

answered Aug 17, 2020 by Niroj
• 82,560 points

Related Questions In Python

0 votes
1 answer
+1 vote
1 answer

How to get the currently logged in user's user id in Django?

Hello @kartik, First make sure you have SessionMiddleware and AuthenticationMiddleware middlewares added ...READ MORE

answered Aug 12, 2020 in Python by Niroj
• 82,560 points
5,210 views
0 votes
1 answer

How to switch pages using Ajax in Django?

You should use django-pjax which is built exactly for ...READ MORE

answered Oct 9, 2018 in Python by aryya
• 7,420 points
537 views
+5 votes
0 answers

How to send sms to users from Django application?

I'm looking for an option to send ...READ MORE

Nov 13, 2018 in Python by Manu
• 170 points
5,155 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
946 views
0 votes
1 answer

How to update date automatically after a value change in django?

Hello @kartik, Only change your pub_date if published has ...READ MORE

answered Jul 2, 2020 in Python by Niroj
• 82,560 points
2,101 views
0 votes
1 answer

How to change the file name of an uploaded file in Django?

Hello @kartik, The basic way is import os os.rename('a.txt', 'b.html') For ...READ MORE

answered Jul 3, 2020 in Python by Niroj
• 82,560 points
525 views