@twitter.route('/twitter_callback')
def twitter_callback():
    try:
        oauth = OAuth1Session(
            client_key=get_settings().twitter_api_key,
            client_secret=get_settings().twitter_api_secret)
        oauth.parse_authorization_response(request.url)

        response = oauth.fetch_access_token(ACCESS_TOKEN_URL)
        access_token = response.get('oauth_token')
        access_token_secret = response.get('oauth_token_secret')

        Setting.query.get('twitter_oauth_token').value = access_token
        Setting.query.get('twitter_oauth_token_secret').value \
            = access_token_secret

        db.session.commit()
        return redirect(url_for('admin.edit_settings'))
    except requests.RequestException as e:
        return make_response(str(e))
Receive the request token from Twitter and convert it to an
dataset/ETHPy150Open kylewm/redwind/redwind/plugins/twitter.py/twitter_callback