0

I came across Storing the secrets (passwords) in a separate file and the comments didn't really come to a conclusive set of suggestions about how to best store credentials.

I was wondering whether storing them in environment variables would suffice or there is another solution that that particular question hasn't surfaced?

One vote for close due to being opinion based despite in my opinion it being a valid question for here.

One vote for close due to needing more focus. Not sure how much more focus I can give.

What are the recommended practices for storing sensitive data in Python?

Thanks

pee2pee
  • 3,445
  • 6
  • 48
  • 120
  • 1
    I personally use `.env` files to store secrets and API keys, if that's what you'd like to know I can explain it. – Achxy_ Jan 22 '22 at 12:24
  • Like these examples: https://medium.com/analytics-vidhya/hiding-secret-keys-and-passwords-in-python-2950c6a4359 ? – pee2pee Jan 22 '22 at 12:24
  • Yes, that's how one makes env files, but parsing them does not require any external modules (like the ones mentioned in the article), using `os.getenv(KEYNAME)` would get you the value of the key. If you'd like I can make another stack thread explaining this. – Achxy_ Jan 22 '22 at 12:29
  • Yes please that could be helpful - thank you – pee2pee Jan 22 '22 at 12:37
  • 1
    Here you go : https://stackoverflow.com/questions/70813009/parsing-env-files/70813010#70813010 That was a long type lol, @pee2pee. – Achxy_ Jan 22 '22 at 12:54

0 Answers0