Comments (2)
This issue seems to be related first to the FULL_URL containing extra parenthesis, and second, the AWS_URL variable is being replaced by itself on the .env. The first is easy to solve, replacing:
FULL_URL="$({AWS_URL})/some-bucket"
with:
FULL_URL="${AWS_URL}/some-bucket"
I'm not sure if the variable expansion is handled with parenthesis, because evaluating what is inside first could have multiple meanings in python. The second is harder to handle though. I'd advice never overwriting the variables with itself:
AWS_URL=${AWS_URL:-http://localhost:9000/s3}
This is basically a recursive replacement, this is actually handled by python-dotenv, not environs, somehow it selects the default value when it finds a recursive replacement (I tried looking at their implementation but didn't find how they handle this case). For me, this .env works as expected:
AWS_URL_PREFIX=http://s3service:9000/s3
AWS_URL=${AWS_URL_PREFIX:-http://localhost:9000/s3}
FULL_URL="${AWS_URL}/some-bucket"
from environs import Env
env = Env(expand_vars=True)
env.read_env()
print(env.str("AWS_URL"))
print(env.str("FULL_URL"))
Gives me:
http://s3service:9000/s3
http://s3service:9000/s3/some-bucket
Process finished with exit code 0
from environs.
Related Issues (20)
- a list-type environment variable contains tuple-type elements HOT 3
- Can't reload The environment variables once you start the application
- RemovedInMarshmallow4Warning: The 'missing' argument to fields is deprecated
- dj-database-url is Out of date HOT 1
- env.url broken after 9.3.3 upgrade HOT 1
- path parser rejects Path defaults HOT 1
- `TypeError: _field2method.<locals>.method()` using `environs[django]` HOT 3
- Log values as they are returned HOT 6
- Bringing environments to subprocess HOT 2
- Default values and subcast
- Is TOML support wanted? HOT 1
- All environment variable names and associated values logged on unhandled env attribute error HOT 3
- errors with raise statements and basestring.... not python3 compatable? HOT 2
- fail if specified .env file does not exist HOT 2
- add "smtp+ssl://, smtp+tls://" supports to email_url HOT 1
- Default values defined in casted types HOT 1
- Inconsistent behavior with `env.list` HOT 1
- Add the ability to create an initial .env file when starting a new project HOT 8
- Support all shell parameter expansion
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 environs.