xdevplatform / Twitter-API-v2-sample-code

Sample code for the Twitter API v2 endpoints
https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api
Apache License 2.0
2.65k stars 984 forks source link

update in using env variable #71

Open 5war00p opened 2 years ago

5war00p commented 2 years ago

I found an issue while we are taking "BEARER_TOKEN" from .env by using os.environ.get("BEARER_TOKEN"). It show 401 because bearer_token was not passing exactly.

So by using this "pip install python-dotenv" module it works fine.

github-actions[bot] commented 2 years ago

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

scott-gr commented 2 years ago

This resolved the 401 error for me. Thanks!