Giter VIP home page Giter VIP logo

Comments (5)

hazemAzzam avatar hazemAzzam commented on August 17, 2024

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.

DonGuillotine avatar DonGuillotine commented on August 17, 2024

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.

almdudler777 avatar almdudler777 commented on August 17, 2024

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.

henriquebastos avatar henriquebastos commented on August 17, 2024

The PR was closed, so I am closing this issue too since we can't reproduce it.

from python-decouple.

DonGuillotine avatar DonGuillotine commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.