How do I delete all entities from my local Google App-engine datastore?
Solution 1
dev_appserver.py --clear_datastore=yes myapp
See here for more info.
Shorthand version:
dev_appserver.py -c
Solution 2
If you came here for a Java solution: Delete the following file:
{project root}/WEB-INF/appengine-generated/local_db.bin
Rebuild and restart your project.
Solution 3
dev_appserver.py [app directory] --clear_datastore true
you need to shutdown the server if its running at the time to free the ports
Solution 4
A useful thing to do is to always specify --datastore_path, e.g. --datastore_path=test.datastore.
To delete it you can then just delete the file. You can also keep copies and swap them in and out. And the store will persist over reboots (when /tmp/ the default location for it on Linux anyway, gets cleared)
Jason Rikard
LAMP developer. Internet enthusiast. BSCS from University of South Carolina.
Updated on July 08, 2022Comments
-
Jason Rikard almost 2 years
How can I remove all entities or reset the local datastore on my dev_appserver? I accidentally recursively called a function to create an entity when testing.
I am using the Google App-engine SDK on Vista with Python.