Languages
Envlet for Python
inject() fills os.environ before your app starts. Django, FastAPI, Flask, and plain scripts read values the way they always did.
Inject
import os
from envlet import inject
inject()
stripe.api_key = os.environ["STRIPE_KEY"]Load
from envlet import load
values = load()
engine = create_engine(values["DATABASE_URL"])Get
from envlet import get
stripe_key = get("STRIPE_KEY")Install
pip install envletSet up
- 01
Install
pip install envlet.
- 02
Set one secret
ENVLET_TOKEN on the server, container, or function.
- 03
Inject at boot
Call inject() at the top of your entrypoint.
Questions
- Will my app start if Envlet is down?
- No, and that is the point. The SDK retries for a few seconds, then fails so you notice. It never starts your app with half an environment.
- What does the host need?
- One variable, ENVLET_TOKEN. Everything else arrives at boot.
- Can I still set some values on the Python host?
- Yes. A value the host already set wins. Pass override if you want Envlet to win instead.