Комментарии:
Heads up for anyone with the "FileNotFoundError: [Errno 2] No such file or directory:" - the file has to be in python's current working directory, which can be found using
print(os.getcwd()) < Once found put your .env file in that location. Alternatively you can specify the file path, but you're exposing where the file is contained:
file_path = '/full/path/to/.test'
with open(file_path, 'r') as file:
line = file.readline()
print(line)
Thank you... Simple and crisp!
ОтветитьBut still you save a STRING of your password..
ОтветитьBeautiful way of teaching. you completed step by step, repeating the mistakes & correcting those so that everyone can understand the reasons behind what u r doing.
ОтветитьCan we access macOS's keychain using python?
p.s. from security standpoint isn't that easer for hacker to get creds from env variables rather than keychain?
could use yaml and just load from a .gitignored pw file
ОтветитьThe way you explained it it very clear. very good! kudos! but still hiding your plain text keys in .env is insecure and big no for secure coding practice :)
ОтветитьVery informative. Thank you!
ОтветитьI love this method of teaching! You go through different mistakes that I would make and talk through how to correct it. Good job!
ОтветитьAre you familiar with a method to encrypt your .env file? I don't like storing any password as plaintext. Have you ever integrated a password manager?
Ответитьэй , ты же русский) давай ка по русскому)
Ответитьinteresting
what?