Try again with dotenv

This commit is contained in:
Alexander Hosking 2023-01-09 00:40:23 -05:00
parent 0c850e7ef2
commit 41f0b57275

View File

@ -8,15 +8,18 @@ from dotenv import load_dotenv, dotenv_values
load_dotenv()
dotenv_file = os.path.realpath(os.path.dirname(__file__)) + "/.env"
print(dotenv_file)
config = dotenv_values(dotenv_file)
EMAIL_ACCOUNTS = json.loads(os.environ.get("MAIL_ACCOUNTS"))
EMAIL_PASSWORDS = json.loads(os.environ.get("MAIL_PASSWORDS"))
# print()
# print(config['DB_URL'])
# print()
# using zip()
# to convert lists to dictionary
accounts = dict(zip(EMAIL_ACCOUNTS, EMAIL_PASSWORDS))
print(accounts)
# print(accounts)
# Influx DB
client = influxdb_client.InfluxDBClient(