appcfg.py upload_data在Windows上忽略--oauth2选项

时间:2014-12-28 19:26:24

标签: python google-app-engine

我正在尝试使用--oauth2选项从Windows 7 PC上传appengine应用程序的数据。它提示我输入失败的凭证。

D:\>appcfg.py --oauth2 --filename=dump.dump upload_data myApp/
10:07 PM Application: myApp
10:07 PM Uploading data records.
[INFO    ] Logging to bulkloader-log-20141228.220722
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
[INFO    ] Opening database: bulkloader-progress-20141228.220722.sql3
[INFO    ] Connecting to myApp.appspot.com/remote_api
Please enter login credentials for myApp.appspot.com
Email: myEmail@gmail.com
Password for myEmail@gmail.com:
Invalid username or password.

但是我希望它不会向我询问有关电子邮件的信息,例如在更新期间发生的事情:

D:\>appcfg.py --oauth2 update myApp/
10:06 PM Application: myApp; version: 1
10:06 PM Host: appengine.google.com
10:06 PM
Starting update of app: myApp, version: 1
10:06 PM Getting current resource limits.
10:06 PM Scanning files on local disk.
10:06 PM Cloning 1 static file.
10:06 PM Cloning 10 application files.
10:06 PM Compilation starting.
10:06 PM Compilation completed.
10:06 PM Starting deployment.
10:06 PM Checking if deployment succeeded.
10:06 PM Deployment successful.
10:06 PM Checking if updated app version is serving.
10:07 PM Completed update of app: myApp, version: 1
10:07 PM Uploading index definitions.

upload_data期间--oauth2有什么问题? 如果需要,我的app.yaml文件就是这样的:

application: myApp
version: 1
runtime: python27
api_version: 1
threadsafe: no

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /remote_api
  script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
  login: admin

- url: .*
  script: main.app

libraries:
- name: webapp2
  version: "2.5.2"
- name: jinja2
  version: "2.6"

1 个答案:

答案 0 :(得分:1)

您需要替换

script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py

with(https://cloud.google.com/appengine/docs/python/tools/remoteapi位于“自定义网址”):

script: google.appengine.ext.remote_api.handler.application

因为您根据runtime:文件中的app.yaml使用了Python 2.7。