Skip to content

Instantly share code, notes, and snippets.

@aritraroy24
Created June 4, 2021 18:30
Show Gist options
  • Save aritraroy24/8091f11362f103c65966d3299a62e2e1 to your computer and use it in GitHub Desktop.
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
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