oauth - Tweepy App Engine example raises 401 exception -


i'm using tweepy google app engine example here basis application: https://github.com/tweepy/examples/tree/master/appengine

the get_authorization_url() method triggers 401 unauthorized exception.

template.render('oauth_example/main.html', {                 "authurl": auth.get_authorization_url(),                 "request_token": auth.request_token                 }) 

in console get:

tweeperror: http error 401: unauthorized 

using library python interpreter works fine:

import tweepy

auth = tweepy.oauthhandler(consumer_key, consumer_secret)

print auth.get_authorization_url()

prints out valid authentication url. same code @ start of mainpage handler in example fails.

class mainpage(requesthandler):    def get(self):     # build new oauth handler , display authorization url user.     auth = tweepy.oauthhandler(consumer_key, consumer_secret)     print auth.get_authorization_url() # exception 401 unauthorized 

any appreciated.

found solution

other updating callback in tweepy callback url, update in app section in dev.twitter.com also.

so, have give correct callback url while

auth = tweepy.oauthhandler(consumer_key, consumer_secret, callback) 

and in twitter app section.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -