从这个问题(Can't deploy my app to Google App Engine),我看到生产GAE可能不允许进口一些产品。我已经减少了以下内容:
import webapp2 # Comes with latest GAE w/ Python 2.7
import os # for loading appropriate files on the server
from google.appengine.ext import db
from google.appengine.api import channel
from google.appengine.ext.webapp import template
我没有直接链接到我的Python脚本中的网站。这是我引用文件的唯一一行。
path = os.path.join(os.path.dirname(__file__), 'myfile.html')
我在家工作,而不是代理人。尽管我已经将所有这些事情视为SO和各种搜索结果中的其他问题的因素,但我仍然会遇到以下错误。
2012-10-11 13:22:01,890 ERROR appcfg.py:2182 An error occurred processing file '':
<urlopen error [Errno 11004] getaddrinfo failed>. Aborting.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 171, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 167, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4191, in <module>
main(sys.argv)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4182, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2579, in Run
self.action(self)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3927, in __call__
return method()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3041, in Update
self.UpdateVersion(rpcserver, self.basepath, appyaml)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3023, in UpdateVersion
lambda path: self.opener(os.path.join(basepath, path), 'rb'))
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2152, in DoUpload
self.resource_limits = GetResourceLimits(self.rpcserver, self.config)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 357, in GetResourceLimits
resource_limits.update(GetRemoteResourceLimits(rpcserver, config))
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 328, in GetRemoteResourceLimits
version=config.version)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 383, in Send
f = self.opener.open(req)
File "C:\Python27\lib\urllib2.py", line 400, in open
url = rest
File "C:\Python27\lib\urllib2.py", line 418, in _open
user_passwd = unquote(user_passwd)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
"""Default error handler: close the connection and raise IOError."""
File "C:\Python27\lib\urllib2.py", line 1215, in https_open
s += unichr(int(item[:2], 16)) + item[2:]
File "C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py",
line 383, in do_open
raise url_error
urllib2.URLError: <urlopen error [Errno 11004] getaddrinfo failed>
2012-10-11 13:22:01 (Process exited with code 1)
所以有错误,我真的不认为这是因为我的代码有多么微不足道。回顾一下:
我没有尝试过的一个解决方案是将环境变量(http_proxy,https_proxy)设置到我的代理,因为我不知道将其设置为什么代理;我没有。在我的项目设置中,我有https://myappname.appspot.com作为Deployment Server。
我该怎么办?您可以立即从我所描述的内容中识别出任何红旗?
注意: