Closed dstarner closed 2 years ago
Hi. I too deploy to different cloud environments, but I'm always able to specify the env vars names. This seems to me that a design challenge on a lower level is being corrected with decouple. Since this is too specific and against the design decisions of the project, this should not be on upstream. If you find ppl interested, maybe you should publish a complimentary library.
@dstarner I think the solution for this is:
AWS_ACCESS_KEY_ID = config('BUCKETEER_AWS_ACCESS_KEY_ID', default=config('S3_ACCESS_KEY_ID',default=None), cast=str)
you can wrap this in a function
I am deploying an application to a few different cloud environments, where equivalent environment variables are not named the same.
To get around this, I wrote a small but super-useful
multi_config
that works the same way asconfig
, but it takes in a variadic number of environment variable names to check. It iterates through these in order and returns the first matching & valid environment variable.I would like to upstream this to the package. I am creating a PR with the feature shortly and will use this issue as a reference.