def get_signin_w_twitter_url(postgres_handle): auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET, callback=CALLBACK) request_token = auth._get_request_token() TwitterSession.create(request_token.key, request_token.secret, postgres_handle) url = "https://api.twitter.com/oauth/authenticate" # might want this: '&force_login=true' request = tweepy.oauth.OAuthRequest.from_token_and_callback(token=request_token, http_url=url, callback=CALLBACK) return request.to_url()