48đź‘Ť
No. It’s impossible, by design. But there should never be a need to do it anyway.
17đź‘Ť
Due to security restrictions the password hash method is one way. You will need to reset that users password.
Try using the set_password(raw_password)
method to give the user a new password. Remember to call the save()
method to ensure you save the change to the database.
u = User.objects.get(username__exact=username)
u.set_password(raw_password)
u.save()
- [Django]-Nginx uwsgi (104: Connection reset by peer) while reading response header from upstream
- [Django]-Django-Rest-Framework. Updating nested object
- [Django]-Django 1.8 migrate is not creating tables
8đź‘Ť
You can check if the password is correct with:
u.check_password("your password")
This method and u.set_password("you password")
solves all of your problems.
sha1$f0971$441cac8f604d49869e33ca125a76253a02fef64e
is:
hash function algorithm $
salt $
hash code
- [Django]-How to customize user profile when using django-allauth
- [Django]-Django, global template variables
- [Django]-Github issues api 401, why? (django)
6đź‘Ť
no. and there shouldn’t be. as part of the security, passwords are passed through a one-way function before they are saved, so that they aren’t reveled if the database is compromised
what you can do is replace the user’s password with one you know. this is how (good) site’s “forgot your password” functions work: they send you a new random password, not your old one, since they (shouldn’t) have access to it
- [Django]-Django @login_required decorator for a superuser
- [Django]-Any thoughts on A/B testing in Django based project?
- [Django]-Disable a method in a ViewSet, django-rest-framework
4đź‘Ť
No, the field contains the salted hash of the password. from the string we know it’s SHA1 function. If you have the password, you will be able to produce the same hash value which acts as the footprint. For security reason there should be now way to recover the password in a economical means (you can still brute force, but will take long time).,
- [Django]-Django-rest-framework accept JSON data?
- [Django]-Comma separated lists in django templates
- [Django]-Error: No module named psycopg2.extensions
0đź‘Ť
There is no way you can get the existing password because that password is been converted to salt hash.
- [Django]-How to discriminate based on HTTP method in django urlpatterns
- [Django]-How do I package a python application to make it pip-installable?
- [Django]-How can I get access to a Django Model field verbose name dynamically?