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

Support loading environment variables with python-dotenv #436

Open
maximlt opened this issue Jan 25, 2023 · 0 comments
Open

Support loading environment variables with python-dotenv #436

maximlt opened this issue Jan 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@maximlt
Copy link
Member

maximlt commented Jan 25, 2023

Lumen supports referencing environment variables via Jinja2 templating {{ env("USER") }}. As a developer an approach I've adopted is to set my environment variables in an .env file and load them dynamically from my Python code with python-dotenv. It is as simple as (copied from their docs):

from dotenv import load_dotenv

load_dotenv()  # take environment variables from .env.

If that's a pattern that makes sense, I was wondering whether Lumen could support that? If so, I imagine that there would be a flag to control whether loading from a .env should be attempted. Just noting that python-dotenv has no dependency itself, if it is considered to make it a dependency of Lumen.

@maximlt maximlt added the enhancement New feature or request label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant