Adding in .env loading of credentials

This commit is contained in:
Lucas Oskorep
2020-05-06 13:16:00 -05:00
parent fca9d9efa2
commit 714f960215
2 changed files with 14 additions and 7 deletions
+12 -5
View File
@@ -1,5 +1,12 @@
# Variables that contains the user credentials to access Twitter API
ACCESS_TOKEN = ""
ACCESS_TOKEN_SECRET = ""
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
# Variables that contains the user credentials to access Twitter API
import os
from dotenv import load_dotenv
load_dotenv()
ACCESS_TOKEN = os.getenv('ATOKEN', '0')
ACCESS_TOKEN_SECRET = os.getenv('ASECRET', '0')
CONSUMER_KEY = os.getenv('APIKEY', '0')
CONSUMER_SECRET = os.getenv('APISECRET', '0')