Hey, I’m relatively new to fly, and I’m coming up against a frustratingly basic issue. I’m using Tigris for my data storage, which sets all the database values as fly secrets by default, which means I can’t just copy-paste them. I need these values to configure my site to actually send and receive data. I’ve read the docs on secrets, and all it says is how to set them, not how to use them in my code. How do I use secrets??? Do I have to import something, is there some special command? Any help is appreciated.
Secrets are set as environment variables. What language are you using? In Node, you would use process.env
. In Ruby ENV
. In Python, os.environ
, …
1 Like
I’m using python. Do I need to import anything? Is it just os.environ(SECRET_NAME)?
os.environ
is a dictionary in Python.
import os
os.environ['SECRET_NAME']
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.