serhii.net

In the middle of the desert you can say anything you want

19 Dec 2021

Python dotenv and python-decouple to separate configs from code

Stumbled upon python-decouple · PyPI, which seems like a “better” dotenv (supports casting, defaults etc)

For example, this is a settings.ini in poetry project root:

[settings]
ECHO=True

I can overwrite these parameters like ECHO=False poetry run python myscript.py

Neat!

Nel mezzo del deserto posso dire tutto quello che voglio.
comments powered by Disqus