且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将数据从GAE复制到本地数据存储失败

更新时间:2023-11-27 22:51:52

我自己找到了解决方案,您必须指定dev应用程序名称,希望这有助于其他人。

  appcfg.py --url = http:// localhost:8080 / _ah / remote_api / --filename = data.csv upload_data -A dev〜myApp src / 


I have followed all the instructions:

1) I downloaded it like this:

appcfg.py download_data -A s~myApp --url=https://myApp.appspot.com/_ah/remote_api/ --filename=data.csv

Note that according to this solution I have to append s~ to the app name, or I get the error message:google.appengine.api.datastore_errors.BadRequestError: app s~myApp cannot access app myApp's data

2) I have to add remote_api access to my app.yaml

- url: /remote_api
  script: google.appengine.ext.remote_api.handler.application
  login: admin

3) I have to run the local server and go to http://localhost:8080/remote_api. In there I enter the admin email for local env and set it as administrator.

4) I upload the csv to local data storage:

appcfg.py --url=http://localhost:8080/_ah/remote_api/ --filename=data.csv upload_data src/

Unfortunately it fails now with this error message:

ApplicationError: ApplicationError: 1 app "dev~myApp" cannot access app "myApp"'s data

What am I missing please?

I found the solution myself, you have to specify the dev application name, hope this helps others.

appcfg.py --url=http://localhost:8080/_ah/remote_api/ --filename=data.csv upload_data -A dev~myApp src/