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

v2ex GAE 下安装 ,twitter OAuth Consumer Key 和 Secret 在哪里申请,是什么东西?

  •  
  •   dbfox · 2011-07-19 15:22:02 +08:00 · 8260 次点击
    这是一个创建于 4869 天前的主题,其中的信息可能已经有所发展或是发生改变。
    这个不太懂啊


    之后,你需要将 config.py.example 复制为 config.py 并做一些必要的修改。比如如果你需要用到 Project Babel 2 内置的 Twitter 客户端,那么你就需要在 config.py 中填入你在 [Twitter](http://twitter.com) 网站上申请的 OAuth Consumer Key 和 Secret。

    为了防止恶意注册,Project Babel 2 还使用了 [reCAPTCHA](http://www.google.com/recaptcha),因此你同样需要在 config.py 填入你自己的 reCAPTCHA 信息。
    14 条回复    1970-01-01 08:00:00 +08:00
    Livid
        1
    Livid  
    MOD
       2011-07-19 15:26:07 +08:00
    dbfox
        2
    dbfox  
    OP
       2011-07-19 15:46:43 +08:00
    @Livid
    WebSite: *
    Your application's publicly accessible home page, where users can go to download, make use of, or find out more information about your application. This fully-qualified URL is used in the source attribution for tweets created by your application and will be shown in user-facing authorization screens.
    (If you don't have a URL yet, just put a placeholder here but remember to change it later.)

    Callback URL:
    Where should we return after successfully authenticating? For @Anywhere applications, only the domain specified in the callback will be used. OAuth 1.0a applications should explicitly specify their oauth_callback URL on the request token step, regardless of the value given here. To restrict your application from using callbacks, leave this field blank.

    晕了,不理解什么意思
    john737
        3
    john737  
       2011-07-19 15:59:14 +08:00
    这两个都可以为空:)
    istef
        4
    istef  
       2011-07-19 16:11:37 +08:00
    不理解是什么的建议你留空,我是认真的。
    dbfox
        5
    dbfox  
    OP
       2011-07-19 16:57:29 +08:00
    config.py 我是这样搞的

    import os

    mobileme_enabled = False
    mobileme_username = ''
    mobileme_password = ''

    if os.environ['SERVER_SOFTWARE'] == 'Development/1.0':
    twitter_consumer_key = 'kyrGq6tPBcxxxxxxxxxx'
    twitter_consumer_secret = '6iJAsESsSNxpsktTuxxxxxxxxxxHk5sQDcW6Sr3mvno'
    else:
    twitter_consumer_key = 'kyrGq6tPBcxxxxxxxxxx'
    twitter_consumer_secret = '6iJAsESsSNxpsktTuxxxxxxxxxxHk5sQDcW6Sr3mvno'

    fts_enabled = False
    fts_server = ''
    fts_username = ''
    fts_password = ''

    # change this for deploy is you can registration from http://www.google.com/recaptcha
    recaptcha_public_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    recaptcha_private_key = 'xxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxx'

    daydream_secret = ''



    下面是用 Google APP Engine 的提示:

    Beginning update of app: zhuozei, version: 1
    Scanning files on local disk.
    Initiating update of app: zhuozei, version: 1
    Password for [email protected]: 2011-07-19 16:59:57,640 ERROR appcfg.py:1935 An unexpected error occurred. Aborting.
    Traceback (most recent call last):
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1884, in DoUpload
    missing_files = self.Begin()
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1617, in Begin
    self.Send('/api/appversion/create', payload=self.config.ToYAML())
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1567, in Send
    return self.rpcserver.Send(url, payload=payload, **self.params)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 358, in Send
    f = self.opener.open(req)
    File "C:\Python27\lib\urllib2.py", line 392, in open
    response = self._open(req, data)
    File "C:\Python27\lib\urllib2.py", line 410, in _open
    '_open', req)
    File "C:\Python27\lib\urllib2.py", line 370, in _call_chain
    result = func(*args)
    File "C:\Python27\lib\urllib2.py", line 1194, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
    File "C:\Program Files\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 367, in do_open
    raise url_error
    URLError: <urlopen error [Errno 8] _ssl.c:499: EOF occurred in violation of protocol>
    Traceback (most recent call last):
    File "C:\Program Files\Google\google_appengine\appcfg.py", line 78, in <module>
    run_file(__file__, globals())
    File "C:\Program Files\Google\google_appengine\appcfg.py", line 74, in run_file
    execfile(script_path, globals_)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3298, in <module>
    main(sys.argv)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3289, in main
    result = AppCfgApp(argv).Run()
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2155, in Run
    self.action(self)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3142, in __call__
    return method()
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2532, in Update
    self.UpdateVersion(rpcserver, basepath, appyaml)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2520, in UpdateVersion
    lambda path: open(os.path.join(basepath, path), 'rb'))
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1884, in DoUpload
    missing_files = self.Begin()
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1617, in Begin
    self.Send('/api/appversion/create', payload=self.config.ToYAML())
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1567, in Send
    return self.rpcserver.Send(url, payload=payload, **self.params)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 358, in Send
    f = self.opener.open(req)
    File "C:\Python27\lib\urllib2.py", line 392, in open
    response = self._open(req, data)
    File "C:\Python27\lib\urllib2.py", line 410, in _open
    '_open', req)
    File "C:\Python27\lib\urllib2.py", line 370, in _call_chain
    result = func(*args)
    File "C:\Python27\lib\urllib2.py", line 1194, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
    File "C:\Program Files\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 367, in do_open
    raise url_error
    urllib2.URLError: <urlopen error [Errno 8] _ssl.c:499: EOF occurred in violation of protocol>
    2011-07-19 16:59:57 (Process exited with code 1)

    You can close this window now.
    dbfox
        6
    dbfox  
    OP
       2011-07-19 17:09:33 +08:00
    @john737 非常感谢你的回复,但是新问题又来了
    Livid
        7
    Livid  
    MOD
       2011-07-19 17:11:27 +08:00
    Google App Engine 需要 Python 2.5,你机器上的 Python 是 2.7。
    dbfox
        8
    dbfox  
    OP
       2011-07-19 17:12:23 +08:00
    @Livid 呃非常感谢你的回复,我继续搞
    dbfox
        9
    dbfox  
    OP
       2011-07-19 17:33:25 +08:00
    经过我一个下午的折腾,最终还是没有成功,
    Python 2.5
    Google App Engine 1.5.1
    出现下列错误

    2011-07-19 17:29:49 Running command: "['C:\\Python25\\pythonw.exe', '-u', 'C:\\Program Files\\Google\\google_appengine\\appcfg.py', '--no_cookies', u'[email protected]', '--passin', 'update', 'D:\\zhuozei']"
    Application: zhuozei; version: 1
    Host: appengine.google.com

    Starting update of app: zhuozei, version: 1
    Scanning files on local disk.
    2011-07-19 17:30:09,515 WARNING appengine_rpc.py:435 ssl module not found.
    Without the ssl module, the identity of the remote host cannot be verified, and
    connections may NOT be secure. To fix this, please install the ssl module from
    http://pypi.python.org/pypi/ssl .
    To learn more, see http://code.google.com/appengine/kb/general.html#rpcssl .
    Password for [email protected]: Could not guess mimetype for static/img/favicon.ico. Using application/octet-stream.
    Cloning 65 static files.
    Cloning 252 application files.
    Cloned 100 files.
    Cloned 200 files.
    Uploading 2 files and blobs.
    Uploaded 2 files and blobs
    Compilation starting.
    2011-07-19 17:32:03,640 ERROR appcfg.py:2064 An unexpected error occurred. Aborting.
    Traceback (most recent call last):
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2029, in DoUpload
    self.Precompile()
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1794, in Precompile
    files = self.PrecompileBatch(files)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1811, in PrecompileBatch
    response = self.Send('/api/appversion/precompile', payload=payload)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1632, in Send
    return self.rpcserver.Send(url, payload=payload, **self.params)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 365, in Send
    f = self.opener.open(req)
    File "C:\Python25\lib\urllib2.py", line 374, in open
    response = self._open(req, data)
    File "C:\Python25\lib\urllib2.py", line 392, in _open
    '_open', req)
    File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
    result = func(*args)
    File "C:\Python25\lib\urllib2.py", line 1109, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
    File "C:\Program Files\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 367, in do_open
    raise url_error
    URLError: <urlopen error (8, 'EOF occurred in violation of protocol')>
    Rolling back the update.
    Traceback (most recent call last):
    File "C:\Program Files\Google\google_appengine\appcfg.py", line 76, in <module>
    run_file(__file__, globals())
    File "C:\Program Files\Google\google_appengine\appcfg.py", line 72, in run_file
    execfile(script_path, globals_)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3708, in <module>
    main(sys.argv)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3699, in main
    result = AppCfgApp(argv).Run()
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2345, in Run
    self.action(self)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 3484, in __call__
    return method()
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2745, in Update
    app_summary = self.UpdateVersion(rpcserver, self.basepath, appyaml)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2734, in UpdateVersion
    lambda path: self.opener(os.path.join(basepath, path), 'rb'))
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 2029, in DoUpload
    self.Precompile()
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1794, in Precompile
    files = self.PrecompileBatch(files)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1811, in PrecompileBatch
    response = self.Send('/api/appversion/precompile', payload=payload)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1632, in Send
    return self.rpcserver.Send(url, payload=payload, **self.params)
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 365, in Send
    f = self.opener.open(req)
    File "C:\Python25\lib\urllib2.py", line 374, in open
    response = self._open(req, data)
    File "C:\Python25\lib\urllib2.py", line 392, in _open
    '_open', req)
    File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
    result = func(*args)
    File "C:\Python25\lib\urllib2.py", line 1109, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
    File "C:\Program Files\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 367, in do_open
    raise url_error
    urllib2.URLError: <urlopen error (8, 'EOF occurred in violation of protocol')>
    2011-07-19 17:32:08 (Process exited with code 1)

    You can close this window now.
    leungxh
        10
    leungxh  
       2011-07-19 17:36:29 +08:00
    @dbfox 开上vpn试试
    Weakdancer
        11
    Weakdancer  
       2011-07-19 17:45:42 +08:00
    @dbfox 这种错误一般是网络状况不佳(受到干扰)的原因,至于为什么不佳你是知道的,经常遇到。
    dbfox
        12
    dbfox  
    OP
       2011-07-19 21:10:09 +08:00
    终于搞好了!
    感谢楼上的各位仁人志士!
    可是新的问题又出现了!
    GAE 搭建的 V2EX 需要 翻墙才能访问,这样很是不爽啊,很是不爽!
    求 方法!
    dbfox
        13
    dbfox  
    OP
       2011-07-19 23:09:32 +08:00
    呃,我搞错了,可以访问了,我的网站是 www.zhuozei.net
    sjep
        14
    sjep  
       2012-02-08 13:00:15 +08:00   ❤️ 1
    daydream_secret
    site_key

    这两个值没有答案

    @livid 可以介绍一下吗?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   969 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:22 · PVG 06:22 · LAX 14:22 · JFK 17:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.