Try again with dotenv
This commit is contained in:
parent
0c850e7ef2
commit
41f0b57275
@ -8,15 +8,18 @@ from dotenv import load_dotenv, dotenv_values
|
|||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
dotenv_file = os.path.realpath(os.path.dirname(__file__)) + "/.env"
|
dotenv_file = os.path.realpath(os.path.dirname(__file__)) + "/.env"
|
||||||
print(dotenv_file)
|
|
||||||
config = dotenv_values(dotenv_file)
|
config = dotenv_values(dotenv_file)
|
||||||
|
|
||||||
EMAIL_ACCOUNTS = json.loads(os.environ.get("MAIL_ACCOUNTS"))
|
EMAIL_ACCOUNTS = json.loads(os.environ.get("MAIL_ACCOUNTS"))
|
||||||
EMAIL_PASSWORDS = json.loads(os.environ.get("MAIL_PASSWORDS"))
|
EMAIL_PASSWORDS = json.loads(os.environ.get("MAIL_PASSWORDS"))
|
||||||
|
|
||||||
|
# print()
|
||||||
|
# print(config['DB_URL'])
|
||||||
|
# print()
|
||||||
# using zip()
|
# using zip()
|
||||||
# to convert lists to dictionary
|
# to convert lists to dictionary
|
||||||
accounts = dict(zip(EMAIL_ACCOUNTS, EMAIL_PASSWORDS))
|
accounts = dict(zip(EMAIL_ACCOUNTS, EMAIL_PASSWORDS))
|
||||||
print(accounts)
|
# print(accounts)
|
||||||
|
|
||||||
# Influx DB
|
# Influx DB
|
||||||
client = influxdb_client.InfluxDBClient(
|
client = influxdb_client.InfluxDBClient(
|
||||||
|
Loading…
Reference in New Issue
Block a user