using .env files in Python to obfuscate API keys
How to make this work:
You need to export the sendgrid key.
Create a file called .env in the same project's directory.
The file should have one line:
export SENDGRID_API_KEY = "contents of key"
Then To run the script and get the contents of the key set up your crontab like this. In this example our script is called mfscp.py.
0 0 1 * * /usr/bin/python3.10 //home/clamm/PycharmProjects/mfscp/.env && home/clamm/PycharmProjects/mfscp/mfscp.py
Comments
Post a Comment