批量上传数据到生产GAE DataStore

时间:2015-02-18 18:52:59

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

我正在尝试批量上传数据到端点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: ****

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

2 个答案:

答案 0 :(得分: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

答案 1 :(得分:0)

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

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

password.txt将包含您的密码,而不是其他任何内容。

相关问题