lumen icon indicating copy to clipboard operation
lumen copied to clipboard

Support loading environment variables with python-dotenv

Open maximlt opened this issue 3 years ago • 0 comments

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 avatar Jan 25 '23 11:01 maximlt