Update . The new version of the Google AppEngine application supports the import and export of data from an online application natively. In their terms, this is called upload_data and download_data respectively ( appcfg.py subcommand appcfg.py ).
See the Google documentation on how to export and import data from / to GAE . This is probably the best way to do it today.
My old answer is below:
I use the to_xml () method of the Model class to export the data store.
class XmlExport(webapp.RequestHandler): def get(self): objects=MyModel.all().fetch(1000) xml='<?xml version="1.0" encoding="UTF-8"?>\n<site>\n' for o in objects: xml = xml + o.to_xml() xml = xml + '</site>' self.response.headers['Content-Type']='text/xml; charset=utf-8' self.response.out.write(xml)
sastanin
source share