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

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

Indently

1 год назад

21,865 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@mortysmith666
@mortysmith666 - 22.10.2023 10:34

Just like Env reader in dart

Ответить
@Cloudxxx23
@Cloudxxx23 - 18.09.2023 17:48

Hi. I assigned luigi123 as my USERNAME in .env but when I printed the username it shows my real name. What gives?🤔

Ответить
@MannyBernabe
@MannyBernabe - 26.08.2023 19:07

helpful. thank you.

Ответить
@arnabmondal2680
@arnabmondal2680 - 21.08.2023 05:04

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

Ответить
@krzysiekkrzysiek9059
@krzysiekkrzysiek9059 - 08.06.2023 22:08

Great video.

Ответить
@aafan.kuware
@aafan.kuware - 14.05.2023 00:04

I use python-decouple.

Ответить
@dipeshsamrawat7957
@dipeshsamrawat7957 - 12.05.2023 10:41

Excellent❤

Ответить
@gravity9999
@gravity9999 - 10.05.2023 22:28

What text editor/IDE you are using

Ответить
@DDecorah
@DDecorah - 29.04.2023 22:44

in@it host-ip

Ответить
@DDecorah
@DDecorah - 29.04.2023 22:31

Ответить
@Assxz
@Assxz - 18.04.2023 13:14

sei italiano?

Ответить
@Sinke_100
@Sinke_100 - 17.04.2023 20:36

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

Ответить
@jjt229
@jjt229 - 17.04.2023 20:15

What about bad english ?

Ответить
@lucaluisi8860
@lucaluisi8860 - 14.04.2023 20:51

Which Is your theme?

Ответить
@lucazirkelbach3151
@lucazirkelbach3151 - 14.04.2023 01:12

Whats your code editor you use

Ответить
@Oler-yx7xj
@Oler-yx7xj - 13.04.2023 22:44

I thought, your channel was called Identity...

Ответить
@pfaelzer2234
@pfaelzer2234 - 13.04.2023 17:46

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?

Ответить
@szesza20
@szesza20 - 13.04.2023 17:01

If you do not want to install the mentioned packege, you can use this istead of load_dotenv:

with open('.env') as f:
os.environ.update({k: v for k, v in [r.split('=') for r in f.readlines()]})

Ответить
@ozzman530
@ozzman530 - 13.04.2023 14:49

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.

Ответить
@ricardokaz
@ricardokaz - 13.04.2023 13:03

Thanks!

Ответить
@ali-g
@ali-g - 13.04.2023 12:31

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

Ответить
@dk-ww3kp
@dk-ww3kp - 13.04.2023 11:34

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

Ответить
@yurix650
@yurix650 - 13.04.2023 11:05

Thanx!

Ответить
@AliHamza-en8cn
@AliHamza-en8cn - 13.04.2023 10:55

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

Ответить
@kaiserkonok
@kaiserkonok - 13.04.2023 09:11

Which IDE or text editor you are using? Please reply

Ответить
@SonuSingh-sn8qg
@SonuSingh-sn8qg - 13.04.2023 09:08

Awesome! Going to implement this tomorrow

Ответить
@MyManJohnny
@MyManJohnny - 13.04.2023 09:08

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.

Ответить
@appuz9220
@appuz9220 - 13.04.2023 09:05

Which IDE is this?

Ответить
@kattamaran
@kattamaran - 13.04.2023 07:21

Do you know if this is secure regarding github copilot? I always wonder what gets pulled from it to make suggestions.

Ответить
@alexjando4880
@alexjando4880 - 13.04.2023 07:18

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.

Ответить