Load Environment Variables From .env Files in Python

  Рет қаралды 75,840

NeuralNine

NeuralNine

Күн бұрын

Пікірлер: 49
@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?
@HrishiBudema
@HrishiBudema 24 күн бұрын
I am a computer science student and this is helpful and even chatgpt didn't give me clear instructions
@beastlorion5245
@beastlorion5245 10 ай бұрын
Awesome tutorial. Thanks for making this quick and painless
@Dev_Gisoun
@Dev_Gisoun 5 ай бұрын
Your lecture was very easy to follow and effective! It was really helpful for me.
@maxwhittaker1175
@maxwhittaker1175 Жыл бұрын
Learn't so much from this channel ❤
@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.
@Roman-kn7kt
@Roman-kn7kt 6 ай бұрын
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 8 ай бұрын
Nice and informative video
@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
@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!
@debashreewaddadar1468
@debashreewaddadar1468 Жыл бұрын
Thank you soo much, it saved me hours of debugging!!! 💟
@krishj8011
@krishj8011 4 ай бұрын
Thanks... Great Tutorial
@murphygreen8484
@murphygreen8484 4 ай бұрын
What is the benefit of doing this over a regular toml or yaml or ini file?
@Lab1401
@Lab1401 Жыл бұрын
Best channel ever for python ❤❤🎉🎉🎉
@krzysiekkrzysiek9059
@krzysiekkrzysiek9059 Жыл бұрын
Awesome tutorial 👍Need more Flask and Django.
@manifestasisanubari
@manifestasisanubari 8 ай бұрын
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 ?
@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 24 күн бұрын
@@explorewithskp1237 python-dotenv
@WaterWheel990
@WaterWheel990 4 ай бұрын
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
@dkjb5756
@dkjb5756 Жыл бұрын
What is this black colour tool Python which version?
@sbj6173
@sbj6173 Жыл бұрын
Thanks for sharing 👍
@The-Martian73
@The-Martian73 Жыл бұрын
What is going on guys welcome back to ... we are going to develop brains !!❤
@ChristopherBruns-o7o
@ChristopherBruns-o7o 3 ай бұрын
can i load my zshrc or netrc/wgetrc
@michaeljosiah536
@michaeljosiah536 11 ай бұрын
Does anybody know how to make this work when you make your Python file into a .exe Python file?
@explorewithskp1237
@explorewithskp1237 Жыл бұрын
I did the same as like in video but getting this erro "Unresolved reference 'dotenv'". Could someone help me
@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
@hamzazahidulislam3490
@hamzazahidulislam3490 7 ай бұрын
Thanks
@ВикторЮпин
@ВикторЮпин 9 ай бұрын
cool man thanks
@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?
@sayalikhairnar3166
@sayalikhairnar3166 9 ай бұрын
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 9 ай бұрын
I had a similar issue because I was trying to install: dotenv instead of python-dotenv
@daviesemmanuel8047
@daviesemmanuel8047 11 ай бұрын
I did the exact same thing but I keep getting (None)
@daviesemmanuel8047
@daviesemmanuel8047 11 ай бұрын
Nevermind I forgot to save the .env file
@aloksheth7477
@aloksheth7477 Ай бұрын
Here i found another video which showing read environment variable using python dotenv kzbin.info/www/bejne/nIXJk6hnd9icp9ksi=iNfXsfzXEEGNComn
@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
@TheCodedSoul
@TheCodedSoul 5 ай бұрын
Subscribe. I feel like this is illegal to learn for free.
Store & manage secrets like API keys in Python - Tech Tip Tuesdays
12:46
The Complete Guide to Python Virtual Environments!
15:52
teclado
Рет қаралды 364 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 47 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 39 МЛН
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 123 МЛН
PIZZA or CHICKEN // Left or Right Challenge
00:18
Hungry FAM
Рет қаралды 15 МЛН
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 814 М.
FULL PYTHON FULL COURSE FOR FREE!🐍
5:12:03
Yousef Computer Science
Рет қаралды 500
My Python Development Environment Setup - Full Tutorial
20:39
Tech With Tim
Рет қаралды 239 М.
Wheel Files: Packaging Python Applications & Modules
21:10
NeuralNine
Рет қаралды 25 М.
Create A Python API in 12 Minutes
12:05
Tech With Tim
Рет қаралды 682 М.
Python Logging: How to Write Logs Like a Pro!
11:02
ArjanCodes
Рет қаралды 177 М.
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 47 МЛН