'Avoid THIS Bad Practise In Python': An Introduction to .env Files

preview_player
Показать описание
Hardcoding your keys / sensitive information in your scripts is a strong red flag when it comes to coding. Let me show you a better alternative by using .env files to store your sensitive information!

▶ Become job-ready with Python:

▶ Follow me on Instagram:
Рекомендации по теме
Комментарии
Автор

An alternative is to use the Python keyring package. An advantage is that the sensitive information is not stored in plain text on the local machine.

fasanojp
Автор

i really love your Python syntax which includes types both for the variables and the function return.
not a lot of python youtube channels properly uses types like that.
I'm currently learning C and Rust, and I have learned Cython before so these static typing are very important.

pietraderdetective
Автор

Awesome! Going to implement this tomorrow

SonuSingh-snqg
Автор

You helped me so much with this video thank you keep up the awesome content👏🔥

dk-wwkp
Автор

I think this is doing the same thing when I store variables in my Linux environment. per the .profile, or .bashrc. Is that accurate? I use this method to store detail but you have to keep an eye on file permissions. On top of that I have went so far and finding ways to encrypt the info using a seed file, but again finding suitable file permissions and places to store the seed should be concerns.

ozzman
Автор

Awesome! Now I finally understand what .env files are for :D

JoePolasek
Автор

Great video🎉, compare to normal json file or txt file, is there any advantage using .env file?

EricHuang-ccuu
Автор

Great video, but if you want to do something native to python, you could do it by using either simple json file, or by just iterating each line of the .env file and adding the environment variables yourself.

alexjando
Автор

Awesome video! What is the difference between a config file and a .env file?

ali-g
Автор

Make a a video how to atore environment variables/secret variables in github and retrieve in it the code, because if i hist the github repo on a platform like c panel, i want make sure api keys correctly retrieved

arnabmondal
Автор

Another option would be to create a json file, and then write a simple wrapper class that you can use to load and access the data.

MyManJohnny
Автор

Good video, but in my case very strange. I took over the source code from you and also .env. But if I execute print('USERNAME...) I see my original USERNAME and not the USERNAME written in .env. Do you know why?

pfaelzer
Автор

Providing types for every variable is maybe more professional aproach, but it's so iritating, I never do it

Sinke_
Автор

I keep a .env.example file in my repos whenever I need to communicate to users and other devs which environment keys need to be set up.

doonk
Автор

Which IDE or text editor you are using? Please reply

kaiserkonok
Автор

Great video. But anybody can have access env in local. Any alternative to be more secure and how the use in production.

AliHamza-encn
Автор

I thought, your channel was called Identity...

Oler-yxxj
visit shbcf.ru