How to use pydantic to read environment variables and secret files in Python
Learn to manage your environment variables in a better way
--
In our Python code, we often need to specify some sensitive information such as database username, password, API keys, JWT tokens, etc. We should not store any sensitive data as plain texts in our source code repository because they can get leaked easily. A common practice is to store the credentials as environmental variables or secret files on the machine on which the application is running. The machine…