app engine datastore auto-clears every time project runs

让人想犯罪 __ 提交于 2019-11-27 08:25:02

问题


Every time I run my project (eith dev_appserver.py myapp or manage.py runserver in django), the datastore will be cleared. I have persisted the data by model.put() or model.save() in django. In the current session, I can see the data in the admin page, but next time I run the project, all previous datastore is lost.

I know app engine has the --clear_datastore run condition, but i dont't want this feature.

By the way, where is there a local datastore file?


回答1:


you can use the --datastore_path=/datastore/path/dev_appserver.datastore parameter with dev_appserver.py

--blobstore_path=/path/to/blobstore/folder is an option too.




回答2:


in fact the --datastore_path= is not the best flag to use because it only sets part of the storage options The best IMHO is:

--storage_path=...

Path at which all local files (such as the Datastore, Blobstore files, Google Cloud Storage Files, logs, etc) will be stored, unless overridden by --datastore_path, --blobstore_path, --logs_path, etc.

found at https://developers.google.com/appengine/docs/python/tools/devserver?csw=1



来源:https://stackoverflow.com/questions/10998936/app-engine-datastore-auto-clears-every-time-project-runs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!