Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy env var to prefixed env vars #72

Kamforka opened this issue Apr 27, 2019 · 2 comments


Copy link

commented Apr 27, 2019

When I proxy a non-prefixed env var to a prefixed one and try to load them an error is thrown.




from environs import Env

env = Env()

with env.prefixed('APP_'):
    ENV = env.str('ENV')


Traceback (most recent call last):
  File "", line 8, in <module>
    ENV = env.str('ENV')
  File "/.../venv/lib/python3.6/site-packages/", line 47, in method
    'Environment variable "{}" not set'.format(proxied_key or parsed_key)
environs.EnvError: Environment variable "FLASK_ENV" not set

Is it intentional to only allow proxying variables within the prefix scope?

Obviously there are many possible workarounds to fix the error, however it feels unintuitive to restrict proxying to a prefix scope.


This comment has been minimized.

Copy link

commented Apr 27, 2019

This appears to be a bug. I won't have time to look at this soon, so I would definitely review and merge a PR.


This comment has been minimized.

Copy link

commented Apr 29, 2019

@sloria Got it. I'll make a PR. Took a look at it and seems like a quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.