V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
liphy
V2EX  ›  Project Babel

link my twitter account 返回错误

  •  
  •   liphy · 2010-11-12 14:32:52 +08:00 · 4464 次点击
    这是一个创建于 4917 天前的主题,其中的信息可能已经有所发展或是发生改变。
    点击“link my twitter account”,返回以下错误,请问是什么原因?谢谢!

    Traceback (most recent call last):
    File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 511, in __call__
    handler.get(*groups)
    File "/base/data/home/apps/*****/1.346122954668006233/t.py", line 50, in get
    request_token = twitter.getRequestToken()
    File "/base/data/home/apps/*****/1.346122954668006233/twitter/oauthtwitter.py", line 189, in getRequestToken
    resp = self._FetchUrl(url, no_cache=True)
    File "/base/data/home/apps/*****/1.346122954668006233/twitter/oauthtwitter.py", line 101, in _FetchUrl
    url_data = opener.open(url).read()
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 387, in open
    response = meth(req, response)
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 498, in http_response
    'http', request, response, code, msg, hdrs)
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 425, in error
    return self._call_chain(*args)
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 506, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    HTTPError: HTTP Error 401: Unauthorized
    8 条回复    1970-01-01 08:00:00 +08:00
    Livid
        1
    Livid  
    MOD
       2010-11-12 14:33:47 +08:00
    是在 V2EX 还是自己的 PB2 上出现这个错误呢?
    liphy
        2
    liphy  
    OP
       2010-11-12 14:34:27 +08:00
    自己的
    Livid
        3
    Livid  
    MOD
       2010-11-12 14:35:05 +08:00
    你填入自己的 CONSUMER KEY/SECRET 了么?
    liphy
        4
    liphy  
    OP
       2010-11-12 14:37:03 +08:00
    if os.environ['SERVER_SOFTWARE'] == 'Development/1.0':
    twitter_consumer_key = '************'
    twitter_consumer_secret = '***********'
    else:
    twitter_consumer_key = ''
    twitter_consumer_secret = ''

    config.py中,这个我只填了第一个if里的,第二个else里的没填,不影响吧?
    Livid
        5
    Livid  
    MOD
       2010-11-12 14:37:30 +08:00
    两个都需要填。
    liphy
        6
    liphy  
    OP
       2010-11-12 14:39:38 +08:00
    那就是说申请两个咯? 还是填一样的?
    call back 都填 http://*****.appspot.com/twitter/oauth
    Application Type: Browser
    Default Access type: Read & Write
    其他的随便填。对吧?
    ratazzi
        7
    ratazzi  
       2010-11-12 16:04:16 +08:00
    一个是测试环境,一个是生产环境,一样就好了
    Livid
        8
    Livid  
    MOD
       2010-11-12 16:07:12 +08:00
    @liphy 对。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4884 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 05:42 · PVG 13:42 · LAX 22:42 · JFK 01:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.