【问题标题】:appcfg.py upload_data ignores --oauth2 option on Windowsappcfg.py upload_data 在 Windows 上忽略 --oauth2 选项
【发布时间】:2014-12-28 19:26:24
【问题描述】:

我正在尝试使用 --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"

【问题讨论】:

    标签: python google-app-engine


    【解决方案1】:

    你需要换行

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

    使用(根据“自定义 URL”处的 https://cloud.google.com/appengine/docs/python/tools/remoteapi):

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

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

    【讨论】:

    • 这并没有改变任何东西。看起来像是访问 remote_api 的凭据问题。除了 Owner 角色,我是否需要提供对 remote_api 的额外访问权限?
    • 通过允许访问不太安全的应用程序解决了这个问题:google.com/settings/security/lesssecureapps
    猜你喜欢
    • 2011-02-05
    • 1970-01-01
    • 2021-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-24
    • 2018-10-11
    相关资源
    最近更新 更多