我正在使用 django non-rel (http://www.allbuttonspressed.com/projects/django -nonrel)并尝试删除我的产品数据存储中的所有数据。我正在阅读此处提出的问题 如何删除 Google 中的所有数据存储区App Engine?但答案对我不起作用。
这是因为我做得不正确还是因为我们使用的是 django,其中层在将数据保存到数据存储之前对数据进行操作?
澄清一下,这些是我删除所有数据存储数据所采取的步骤。
-
我转到了程序文件中的 google app engine 文件夹
在命令行中输入了“remote_shell_api.py yourapp /remote_api”
-
当我成功登录时,我尝试导入我的一个应用程序文件夹,但它不允许我导入它,更不用说删除它了。
-
当然,输入我的项目的等效项也失败了
from models import Entry
query = Entry.all()
entries =query.fetch(1000)
db.delete(entries)
我还考虑执行此处的步骤(http://code.google.com/appengine/docs/python/tools/uploadingdata.html)但是我真的很困惑。有人可以澄清一下过程吗?它与普通的谷歌应用程序引擎项目不同吗?如果有,我们如何使用它?
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?
发布评论
评论(3)
这里有两个问题:
PYTHONPATH=path_to_your_app remote_api_shell.py yourapp
。与此相关的是,如果您有大量数据,您可能需要使用新的 mapreduce相反,它完全在服务器上运行并且速度更快。
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.
您尝试过以下方法吗?
Entry
是您的 Django 模型。Have you tried the following?
Entry
being your Django model.事实证明,django non-rel 使用自己的远程 shell。因此,
manage.py 远程 shell
将带您进入应用程序引擎,您可以在其中删除正确映射到应用程序引擎数据存储区的数据。感谢大家的帮助!
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!