Reputation: 943
I'm using django non-rel (http://www.allbuttonspressed.com/projects/django-nonrel) and am trying to delete all the data in my production's datastore. I was reading the question posed here How to delete all datastore in Google App Engine? but the answer wasn't working for me.
Is this because I'm not doing it correctly or because we are using a django where the layers manipulate the data before being saved onto datastore?
Just to clarify, these are the steps I've taken to delete all datastore data.
I went to google app engine's folder in program files
In command line, entered "remote_shell_api.py yourapp /remote_api"
when I got in successfully, I tried to import one of my app folders but it wouldn't allow me to import it, let alone delete it.
Of course, typing my project's equivalent of this also failed
from models import Entry
query = Entry.all()
entries =query.fetch(1000)
db.delete(entries)
I also looked into doing the steps in here (http://code.google.com/appengine/docs/python/tools/uploadingdata.html) but I got really confused. Can anybody clarify the process? Is it different than the normal google app engine projects, if so, how do we use it?
Upvotes: 4
Views: 1189
Reputation: 943
As it turns out, django non-rel uses its own remote shell. So
manage.py remote shell
will take you into app engine where you can delete your data that is properly mapped into app engine's datastore. Thanks for all the help guys!
Upvotes: -1
Reputation: 2481
Have you tried the following?
Entry.objects.all().delete()
Entry
being your Django model.
Upvotes: 1
Reputation: 101149
There's two issues at work here:
PYTHONPATH=path_to_your_app remote_api_shell.py yourapp
.On a related note, if you have a lot of data, you may want to use the new mapreduce library instead, which runs entirely on the server and will be much faster.
Upvotes: 3