How to delete all datastore in Google App Engine?

后端 未结 29 1895
夕颜
夕颜 2020-11-28 01:17

Does anyone know how to delete all datastore in Google App Engine?

29条回答
  •  旧时难觅i
    2020-11-28 01:53

    The zero-setup way to do this is to send an execute-arbitrary-code HTTP request to the admin service that your running app already, automatically, has:

    import urllib
    import urllib2
    
    urllib2.urlopen('http://localhost:8080/_ah/admin/interactive/execute',
        data = urllib.urlencode({'code' : 'from google.appengine.ext import db\n' +
                                          'db.delete(db.Query())'}))
    

提交回复
热议问题