【问题标题】:Bulk upload data to production GAE DataStore将数据批量上传到生产 GAE 数据存储
【发布时间】:2016-11-16 21:49:11
【问题描述】:

我正在尝试将数据批量上传到端点 http://my-app.appspot.com/_ah/remoteapi,其中 my-app 是我的应用的 ID。

这是我的 app.yaml 的一部分

- url: /_ah/.*
  script: google.appengine.ext.remote_api.handler.application

这是我使用的命令

appcfg.py upload_data --config_file=bulkloader.yaml --application whats-the-code --url=http://my-app.appspot.com/_ah/remote_api --filename=data/songs.xml --kind=Song --namespace=songs

问题是总是提示我输入凭据:

Please enter login credentials for my-app.appspot.com
Email: admin@some.host.com
Password for admin@some.host.com: ****

如何配置应用程序以绕过身份验证?在这种情况下如何指定要使用的正确电子邮件/密码?

【问题讨论】:

    标签: google-app-engine google-cloud-datastore


    【解决方案1】:

    使用--oauth2 标志而不是用户/密码。

    $ appcfg.py upload_data --oauth2 --config_file=bulkloader.yaml --application whats-the-code --url=http://my-app.appspot.com/_ah/remote_api --filename=data/songs.xml --kind=Song --namespace=songs
    

    【讨论】:

    • 让我检查一下!我已经建立了一个支持导入/导出的后台!谢谢你们!
    【解决方案2】:

    您可以通过--email 指定电子邮件,appcfg 可以通过设置开关--passin 从标准输入获取密码。拥有 -passin 后,您可以通过管道输入包含您的密码的文件,如下所示

    appcfg.py < your all other options> --email <your email> --passin < password.txt
    

    password.txt 将包含您的密码,仅此而已。

    【讨论】:

      猜你喜欢
      • 2013-12-25
      • 2014-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-25
      • 1970-01-01
      • 1970-01-01
      • 2014-06-20
      相关资源
      最近更新 更多