Snippet to add Twitter login to your Flask app. Basically I got this working (myreadinglist app) and adapted it slightly when testing.
### Steps
-
Create Twitter app, see printscreen below, note the Callback URL.
-
Note down consumer_key and consumer_secret
-
Set env vars (and/or persist them in your .bashrc):
$ export PYB_100D_TW_KEY=abc $ export PYB_100D_TW_SECRET=def $ export PYB_100D_APP_SECRET=ghi
-
Start app:
$ python app.py
Create app:
Login:
Twitter asks you to authorize the app:
Logout:
Do actual stuff with Twitter API (load feed, post, etc)