lumen
lumen copied to clipboard
Support loading environment variables with python-dotenv
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.