Possible Duplicate:
Is there a portable way to get the current username in Python?
How can I get the username of the account by which the given script is being executed?
Community♦
defiantdefiant
1,01888 gold badges2424 silver badges4848 bronze badges
marked as duplicate by Josh Lee, ThiefMaster, Chris Thompson, SilentGhost, sdcvvcDec 1 '10 at 14:41Django Password History
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1 Answer
werehumanwerehuman
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged python or ask your own question.
I have a python library which I wrote for something else. So I import that to use in Django, problem I am facing is how to get the password.
Jan 22, 2017 I noticed that starter pack 2015 was not on moddb, so I decided to post it there for convenience of the people. While going through the pack I noticed that some stuff was either old or not there. For example there is OWR3 for SoC with a patch for ZRP and looks like the pack contained older version of Absolute textures. Jun 02, 2017 Part 01: The Car Park Let's revisit a classic in STALKER: Shadow of Chernobyl with the STARTER Pack 2017 mod. Compiled by MightySDS on ModDB, it provides bugfixes, new textures, new shaders, new. Stalker soc starter pack. Aug 02, 2012 Video instructions for installing the 'Stalker Starter Pack' mods for STALKER: Shadow Of Chernobyl. This mod pack is compilation of fixes and mods to give first timers the smoothest VANILLA. Jul 21, 2017 Hello folks! So recently I've noticed that I've missed some things that I could've added to the previous version STARTER PACK(Autumn Aurora 2.1 shaders) and someone also ported the HD models from Call of Chernobyl to Shadow of Chernobyl(job well done!) which would make a fine addition to this collection.
username I can pass in through request.user
But, I am not sure how to get the password. Can someone help me? Thanks.
user1012451user1012451
1,17555 gold badges2121 silver badges2929 bronze badges
3 Answers
Your function
mycustom_lib_function should not be using a plaintext password. After a user authenticates with your application, you have a User object (from django.contrib.auth.models ) that contains a hashed password:
The actual password typed into your form is not stored in plaintext, as standard web security advises you not to store plaintext values of passwords after authentication.
Note that you could check the above hash by performing: Delphi direct evolution buy.
Now if your application wraps into another application that you do not control that needs a password to do certain actions, you can possibly consider storing their password in plaintext (or slightly better encrypting it), but
django.contrib.auth will not do this for you. It would be better if you set up an OAuth type credential system, which does exactly this functionality without necessitating users reveal their password to the intermediate site.
If its an application that you do control, I would drop the requirement for password to be passed to it.
dr jimbobdr jimbob
13.1k33 gold badges4545 silver badges7171 bronze badges
The password in Ignacio Vazquez-AbramsIgnacio Vazquez-Abrams
User is hashed, and so you cannot get it. Ask the user.
603k109109 gold badges11021102 silver badges11911191 bronze badges
You technically can store the password as plain-text but its not right from a security stand poit, see this answer, it is highly not recommended! django.contrib.auth.hashers has some good tools to use for passwords, see the official Django docs.
If you have an idea what the plain-text password could be, i.e. I have a globally stored default password in one of my applications that is stored in plain-text, as in the example below. To check if a user has their password set to the default one, you can use the check_password function that will return True if the plain-text matches the encoded password:
Also see is_password_usable, and make_password functions.
Community♦
radtekradtek
17.3k66 gold badges9191 silver badges8181 bronze badges
Not the answer you're looking for? Browse other questions tagged django or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |