|
|
|
|
|
by ceol
4773 days ago
|
|
For Python website projects, I enforce the creation of a _secrets.py file in the config folder that is ignored by git and contains all sensitive constants like database information and tokens. Then, in the _base.py settings file (what all other settings files inherit from), I make sure to `from _secrets import *`. I'm not a fan of setting tokens by environment because it gets a little too unwieldy to make sure bash/zsh/whatever sets the variable. I haven't run into any problems using that method. Does anyone see a reason to prefer environment variables over it? |
|
The envdir program (from daemontools) is useful for setting environment variables in a shell-agnostic way, e.g., run your app with:
See alsohttp://12factor.net/config