gpt4 book ai didi

google-app-engine - 如何创建 GAE 数据存储的本地副本?

转载 作者:太空宇宙 更新时间:2023-11-03 15:17:48 24 4
gpt4 key购买 nike

我想制作存储在线版本准确数据的 GAE 应用程序客户端版本。(myapp.appspot.com) 如果我可以改用 sdk,是否有任何库或工具可以同步在线版本和 sdk 版本?我尝试使用 bulkloader 但无法将下载的数据加载到本地 SDK?请帮忙。

最佳答案

this article 中所述(链接已更新,感谢 Zied Hamdi)

你只需要启用远程api

builtins:
- remote_api: on

更新您的应用程序,然后运行以下命令:

appcfg.py download_data -A s~YOUR_APP_NAME --url=http://YOUR_APP_NAME.appspot.com/_ah/remote_api/ --filename=data.csv
appcfg.py --url=http://localhost:8080/_ah/remote_api/ --filename=data.csv upload_data .

针对 2016 年 4 月 12 日之后的最新 AppEngine SDK 进行编辑:

以上适用于 SDK 1.9.0 及之前版本。然而与 depreciation of ClientLogin ,以上会导致错误

03:13 PM Uploading data records.
[INFO ] Logging to bulkloader-log-20160909.151355
[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-20160909.151355.sql3
2016-09-09 15:13:55,175 INFO client.py:578 Refreshing due to a 401 (attempt 1/2)
2016-09-09 15:13:55,176 INFO client.py:804 Refreshing access_token
2016-09-09 15:13:55,312 INFO client.py:578 Refreshing due to a 401 (attempt 2/2)

Recommended by Anssi here,我们可以直接使用 API 服务器而不会遇到这个错误。对于典型的 dev_appserver 启动,您会得到以下输出

INFO     2016-09-09 19:27:11,662 sdk_update_checker.py:229] Checking for updates to the SDK.
INFO 2016-09-09 19:27:11,899 api_server.py:205] Starting API server at: http://localhost:52497
INFO 2016-09-09 19:27:11,905 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO 2016-09-09 19:27:11,918 admin_server.py:116] Starting admin server at: http://localhost:8000

在这种情况下,使用 API 端口代替上面的上传

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

关于google-app-engine - 如何创建 GAE 数据存储的本地副本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2671438/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com