sfdye
sfdye

Reputation: 296

app engine datastore auto-clears every time project runs

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?

Upvotes: 1

Views: 645

Answers (2)

mrauto
mrauto

Reputation: 91

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

Upvotes: 1

aschmid00
aschmid00

Reputation: 7158

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.

Upvotes: 3

Related Questions