Created
June 4, 2021 18:30
-
-
Save aritraroy24/8091f11362f103c65966d3299a62e2e1 to your computer and use it in GitHub Desktop.
code to be used if any KeyError arises at the time of getting the credentials
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decouple import config | |
# Keys | |
CONSUMER_KEY = config('Consumer_Key') | |
CONSUMER_SECRET_KEY = config('Consumer_Secret_Key') | |
ACCESS_TOKEN = config('Access_Token') | |
ACCESS_TOKEN_SECRET = config('Access_Token_Secret') | |
# Authentication | |
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET_KEY) | |
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) | |
api = tweepy.API(auth) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment