Comments (5)
check this pull request
https://github.com/HBNetwork/python-decouple/pull/165
I have encountred the same issue, and I found that it retrieves the values from the os.environ first before checking the repository file so that when you update your variables it does not updated in the os.environ
so I changed the if statement to check the repository file first
from python-decouple.
check this pull request https://github.com/HBNetwork/python-decouple/pull/165
I have encountred the same issue, and I found that it retrieves the values from the os.environ first before checking the repository file so that when you update your variables it does not updated in the os.environ so I changed the if statement to check the repository file first
Thanks @hazemAzzam, I hope it gets merged.
from python-decouple.
Does this problem still exist? The Problem of @hazemAzzam was with .env files.
As i understand this Issue; you're not using .env files??
Sorry if that question is obsolete - i'm not familliar with AWS Beanstalk.
The UndefinedValueError
is only raised in one spot - after decouple checks the os.environ and then its internal repository (either .env or .ini file). If neither does contain the key you're looking for the error is raised.
It checks the os.environ by using its __contains__
method - ie. by doing if key in os.environ: return os.environ[key]
.
When you say you worked around this by using os.environ.get(key); which should only differ from os.environ[key] by not raising KeyError if key
does not exist.
When you switched to os.environ.get(...) are you by any chance supplying a default (2nd param) aswell?
from python-decouple.
The PR was closed, so I am closing this issue too since we can't reproduce it.
from python-decouple.
Apologies for any inconvenience caused, I found out that I activated the wrong virtual Environment.
Once I activated the correct one python-decouple
was able to fetch environment variables set in the Elastic Beanstalk environment correctly.
from python-decouple.
Related Issues (20)
- Pycharm and the python-decouple package HOT 2
- Support for multiline strings HOT 9
- Pyright reportGeneralTypeIssues error with cast HOT 1
- Add type hints HOT 1
- Feature request: Cascaded settings files HOT 8
- question Changing settings HOT 2
- Feature Request: Fallback to .env.example HOT 3
- decouple.UndefinedValueError: SECRET_KEY not found. Declare it as envvar or define a default value. HOT 4
- Csv(None) hangs
- Infinite recursion in _find_file on Windows when called via pytest HOT 5
- Cascaded Settings Files
- This bugs me so much - Install name differs from package name causing IDE warnings HOT 1
- Feature idea: optional value HOT 2
- decouple.UndefinedValueError: SECRET_KEY not found. HOT 1
- ENV when use Csv can't be optional HOT 1
- Issue with typings using Pylance type checking HOT 2
- profiling through environment variables HOT 1
- Issues with installation using pipenv HOT 2
- Installation with Poetry give back an error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-decouple.