Load Environment Variables From .env Files in Python

  Рет қаралды 80,439

NeuralNine

NeuralNine

Күн бұрын

Пікірлер: 51
@kenkioqqo
@kenkioqqo Жыл бұрын
I'm on your third video, and it's absolutely mind-boggling how you happen to be teaching the exact Python concepts I want to learn quickly for my current project. You're just the helper I was looking for.
@kylecurry6841
@kylecurry6841 Жыл бұрын
Ironically, I just began using python-decouple for .env files which happens to be one of a few late improvements in my scripting. Love this channel, definitely a gold mine of dev related knowledge.
@Stopinvadingmyhardware
@Stopinvadingmyhardware Жыл бұрын
How does that function?
@maxwhittaker1175
@maxwhittaker1175 Жыл бұрын
Learn't so much from this channel ❤
@beastlorion5245
@beastlorion5245 Жыл бұрын
Awesome tutorial. Thanks for making this quick and painless
@Dev_Gisoun
@Dev_Gisoun 7 ай бұрын
Your lecture was very easy to follow and effective! It was really helpful for me.
@birdie123
@birdie123 Жыл бұрын
What are the pros and cons of using .ini, .env, .toml and .yaml for storing environment variables?
@TheGreatMind55
@TheGreatMind55 Жыл бұрын
The choice of a configuration format for storing environment variables (or other configuration settings) depends on various factors, including ease of use, readability, and the specific needs of your application. .ini: Pros: Simple and Human-Readable: .ini files are straightforward to read and write. They use a plain text format with a simple key-value structure. Widely Supported: .ini files are supported by a wide range of programming languages and libraries, making them versatile for configuration. Cons: Limited Structure: .ini files lack complex data types, which can be a limitation for more advanced configuration needs. No Nested Structures: .ini files do not support nested structures, making it harder to organize complex configurations. .env (Environment Variables): Pros: Security: .env files are a secure way to store sensitive environment variables since they are typically not committed to version control. Platform-Agnostic: .env files are compatible with most platforms and languages, and they can be used in different development and deployment environments. Cons: Limited to Key-Value Pairs: .env files are limited to key-value pairs and don't support complex data structures. No Comments or Metadata: .env files lack the ability to add comments or metadata, making it harder to provide context for each variable. .toml: Pros: Rich Data Types: TOML supports a wide range of data types, including arrays, tables, and nested structures. Human-Readable: TOML is designed to be easy to read and write for humans. Comments: TOML allows comments, which can provide valuable context for each variable. Cons: Complexity: The richer data types in TOML can add complexity to the configuration, which may not be necessary for simple settings. .yaml (YAML): Pros: Highly Readable: YAML is known for its high readability and is often used for configuration files. Rich Data Types: YAML supports complex data structures, including lists and dictionaries, making it suitable for more complex configurations. Comments: Some YAML implementations support comments, providing context for variables. Cons: Indentation Sensitive: YAML relies on indentation for structure, which can be a source of issues when formatting is inconsistent. Potential Security Risks: Be cautious when using YAML for sensitive data, as it's not designed for security like .env files. In summary, the choice of format depends on your specific requirements. If you need a simple, human-readable format, .ini or .env might be suitable. If you need richer data types and nesting, TOML and YAML are better choices. Additionally, consider security, compatibility with your development stack, and whether comments and metadata are important for providing context in your configuration files.
@debashreewaddadar1468
@debashreewaddadar1468 Жыл бұрын
Thank you soo much, it saved me hours of debugging!!! 💟
@Roman-kn7kt
@Roman-kn7kt 8 ай бұрын
Oh, that look “If you don’t understand through my video what I explained to you, I’ll punch you”😅😅😅 Thank you so much for your content, sir, you are the best!
@tanuj05
@tanuj05 10 ай бұрын
Nice and informative video
@Lab1401
@Lab1401 Жыл бұрын
Best channel ever for python ❤❤🎉🎉🎉
@piotrmazgaj
@piotrmazgaj Ай бұрын
This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.
@HrishiBudema
@HrishiBudema 2 ай бұрын
I am a computer science student and this is helpful and even chatgpt didn't give me clear instructions
@AppaloosaMichael
@AppaloosaMichael Жыл бұрын
Hello, I am confused by your use of $ and non-string values within your dotenv file. What is the purpose of this? Sorry if this is a dumb question & thanks for your video
@krishj8011
@krishj8011 6 ай бұрын
Thanks... Great Tutorial
@wg2
@wg2 Жыл бұрын
Hey, thanks a bunch! So, the other day I accidentally made my OpenAI API key public for a short while, and had to delete the whole repository. But thanks to your help, I'm following best practices now. By the way, I can't help but notice your white board - looks like there are some differential equations and a neural network model, maybe some content related to gradient descent too? It's really intriguing!
@abbaraphael2930
@abbaraphael2930 10 күн бұрын
This is great! Thanks
@sbj6173
@sbj6173 Жыл бұрын
Thanks for sharing 👍
@murphygreen8484
@murphygreen8484 6 ай бұрын
What is the benefit of doing this over a regular toml or yaml or ini file?
@didierdavid9324
@didierdavid9324 Жыл бұрын
Thanks for this tutorial Which plugin do you use in Pycharm to detect .env and .secret files
@explorewithskp1237
@explorewithskp1237 Жыл бұрын
I also did the same as in video but getting error like " Unresolved reference 'dotenv' "
@adamtrott78
@adamtrott78 2 ай бұрын
@@explorewithskp1237 python-dotenv
@krzysiekkrzysiek9059
@krzysiekkrzysiek9059 Жыл бұрын
Awesome tutorial 👍Need more Flask and Django.
@hamzazahidulislam3490
@hamzazahidulislam3490 9 ай бұрын
Thanks
@manifestasisanubari
@manifestasisanubari 10 ай бұрын
Is it recommended to store list and integer in .env? Because I need to convert `os.getenv()` with `ast.literal_eval` before passing as a variable. I store related RSS URL as a list in my script.
@itstobystic
@itstobystic Жыл бұрын
what happens when you have more than one .env file ?
@WaterWheel990
@WaterWheel990 6 ай бұрын
How would I handle Environmental Variables with Inno Setup?
@olorundaremicheal8015
@olorundaremicheal8015 Жыл бұрын
Thanks for this tutorials, actually have been struggling to get a way around this .env thing for a while with a kivy app. Please I mean to ask, is this a very secure way to do it or there are other ways plus when I try to use it with my kivy app, bulldozer keeps giving me errors whenever it tries to download the dotenv module. Thanks in anticipation boss
@michaeljosiah536
@michaeljosiah536 Жыл бұрын
Does anybody know how to make this work when you make your Python file into a .exe Python file?
@dkjb5756
@dkjb5756 Жыл бұрын
What is this black colour tool Python which version?
@ChristopherBruns-o7o
@ChristopherBruns-o7o 5 ай бұрын
can i load my zshrc or netrc/wgetrc
@explorewithskp1237
@explorewithskp1237 Жыл бұрын
I did the same as like in video but getting this erro "Unresolved reference 'dotenv'". Could someone help me
@The-Martian73
@The-Martian73 Жыл бұрын
What is going on guys welcome back to ... we are going to develop brains !!❤
@eugeneL_N1E104
@eugeneL_N1E104 Жыл бұрын
maybe can add to your python tip&tricks playlist or add a series of python 3rd party useful toolkits list XD
@ВикторЮпин
@ВикторЮпин 11 ай бұрын
cool man thanks
@sayalikhairnar3166
@sayalikhairnar3166 11 ай бұрын
I am not able to install dotenv. It is showing - could not be able to find the right version. Anybody know it's solution??
@mbegaliful
@mbegaliful 11 ай бұрын
I had a similar issue because I was trying to install: dotenv instead of python-dotenv
@daviesemmanuel8047
@daviesemmanuel8047 Жыл бұрын
I did the exact same thing but I keep getting (None)
@daviesemmanuel8047
@daviesemmanuel8047 Жыл бұрын
Nevermind I forgot to save the .env file
@TheDavidlloydjones
@TheDavidlloydjones Жыл бұрын
"Let us get right into it," you say. I think you already did. This "so let's get started" thingie is all over KZbin -- always spoken by people who have already started. One thank-you, though: thank you for skipping the "without further ado."
@FIGP1
@FIGP1 Жыл бұрын
Yes, just like hello, hi, etc. are used by a lot of people. Does that mean that we should stop using those?
@bfkmnemonic
@bfkmnemonic Жыл бұрын
I struggle to see the benefit of using environment variables loaded from a file compared to loading setting directly from a file (json, ini) into program variables. It seems unnecessary and inefficient to have to bother the operating system every time you need a value.
@StNicolay
@StNicolay Жыл бұрын
So do I, but I have to say that they are incredibly useful if your application can be run in a docker container because it's the easiest way to provide configuration in that situation
@leftblank5315
@leftblank5315 Жыл бұрын
It's industry standard, especially when deploying workloads in containers/serverless
@aloksheth7477
@aloksheth7477 3 ай бұрын
Here i found another video which showing read environment variable using python dotenv kzbin.info/www/bejne/nIXJk6hnd9icp9ksi=iNfXsfzXEEGNComn
@TheCodedSoul
@TheCodedSoul 7 ай бұрын
Subscribe. I feel like this is illegal to learn for free.
Store & manage secrets like API keys in Python - Tech Tip Tuesdays
12:46
5 Python Libraries You Should Know in 2025!
22:30
Keith Galli
Рет қаралды 84 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Linux for Programmers #7 | Environment Variables
12:31
Akamai Developer
Рет қаралды 42 М.
Create Stunning Python GUIs in 10 Minutes With Drag & Drop
11:38
Coding Is Fun
Рет қаралды 111 М.
Working with YAML Files in Python
16:47
NeuralNine
Рет қаралды 49 М.
SQLAlchemy Turns Python Objects Into Database Entries
22:23
NeuralNine
Рет қаралды 188 М.
What are Environment Variables ? with Examples on Windows & Linux
13:22
Modern Python logging
21:32
mCoding
Рет қаралды 214 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 411 М.
What does '__init__.py' do in Python?
6:50
Indently
Рет қаралды 96 М.