49

这是使用 Python SDK 1.8.0 版。

我的远程 API 使用 可以正常remote_api_shell.py工作,但在尝试从 python 脚本中访问时不起作用。我正在使用来自谷歌的示例代码

from google.appengine.ext.remote_api import remote_api_stub
import getpass

def auth_func():
  return (raw_input('Username:'), getpass.getpass('Password:'))

remote_api_stub.ConfigureRemoteApi(None, '/_ah/remote_api', auth_func,
                               'localhost:8080')

而且我还在导入fix_sys_path()fromdev_appserver.py以正确设置我sys.path的谷歌应用引擎 SDK:

import dev_appserver
dev_appserver.fix_sys_path()

在其他路径中,将以下行添加到 my sys.path

'/google_appengine_1.8.0/lib/fancy_urllib'

但是,调用上述调用时会引发以下错误remote_api_stub.ConfigureRemoteApi()

opener.add_handler(fancy_urllib.FancyProxyHandler())
AttributeError: 'module' object has no attribute 'FancyProxyHandler'
4

1 回答 1

2

等待 7 年,一切似乎都很好。

于 2021-03-24T13:22:21.167 回答