Google App Engine remote_api: deleting all data in django nonrel

I am using django non-rel ( http://www.allbuttonspressed.com/projects/django-nonrel ) and trying to delete all the data in my production data warehouse. I read the question asked here. How to delete all data stores in Google App Engine? but the answer did not work for me.

Is it because I am not doing it right or because we are using django, where are the layers manipulating the data before saving it to the data store?

To clarify, these are the steps I took to delete all data warehouse data.

  • I went to the folder with the Google engine in the program files

  • At the command prompt, enter "remote_shell_api.py yourapp / remote_api"

  • when I got it successfully, I tried to import one of my application folders, but it will not let me import it, not to mention deleting it.

  • Of course, entering the text of my project equivalent also failed

from models import Entry query = Entry.all() entries =query.fetch(1000) db.delete(entries) 

I also studied the steps here ( http://code.google.com/appengine/docs/python/tools/uploadingdata.html ), but I'm really confused. Can anyone clarify this process? Is this different from regular Google engine projects, if so, how do we use it?

+4
source share
3 answers

As it turned out, django non-rel uses its own remote shell. So,

remote manage.py shell

will lead you to the application engine, where you can delete your data that is correctly displayed in the application data store. Thanks for helping everyone!

-1
source

There are two questions here:

  • To import your packages and modules, they must be on PYTHONPATH. To do this, run the shell with the set of variables PYTHONPATH: PYTHONPATH=path_to_your_app remote_api_shell.py yourapp .
  • The various Django templates for the App Engine change the datastore model class to change the name of the view to be fully qualified — for example, the “Foo” model defined in the “bar” module will be “bar_Foo” in Django, and the App Engine alone calls it "foo." In order for this patch to be applied, you need to make sure that you import the appropriate parts of the Django patch to allow it to use this monkeypatch file.

In the corresponding note, if you have a lot of data, you can instead use the new mapreduce library , which works completely on the server and will be much faster.

+3
source

Have you tried the following?

 Entry.objects.all().delete() 

Entry is your Django model.

+1
source

Source: https://habr.com/ru/post/1313784/


All Articles