简体   繁体   English

从实时Google App Engine应用程序导出数据的最简单方法是什么?

[英]What is the easiest way to export data from a live Google App Engine application?

我对可用源代码的解决方案特别感兴趣(Django独立性是一个优点,但我愿意破解我的方式)

You can, of course, write your own handler. 当然,您可以编写自己的处理程序。 Other than that, your options currently are limited to: 除此之外,您的选择目前仅限于:

  • gae-rest , which provides a RESTful interface to the datastore. gae-rest ,为数据存储区提供RESTful接口。
  • approcket , a tool for replicating between MySQL and App Engine. approcket ,一种在MySQL和App Engine之间复制的工具。
  • The amusingly named GAEBAR - Google App Engine Backup and Restore. 有趣的名称GAEBAR - Google App Engine备份和还原。

Update : New version of Google AppEngine supports data import to and export from the online application natively. 更新 :新版Google AppEngine支持本地导入和导出在线应用程序的数据。 In their terms this is called upload_data and download_data respectively (names of subcommands of appcfg.py ). 在他们的术语中,这分别称为upload_datadownload_dataappcfg.py的子命令的名称)。

Please refer to Google documentation how to export and import data from/to GAE . 请参阅Google文档, 了解如何从/向GAE导出和导入数据 This is probably the better way to do it today. 这可能是今天更好的方法。

My old answer is below: 我的回答如下:


I use to_xml() method of the Model class to export the datastore. 我使用Model类的to_xml()方法导出数据存储区。

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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将数据从Google App Engine导出到csv - Export data from Google App Engine to csv 对于完整的应用程序,在 Python 中使用 DAO 引擎(访问)的最简单方法是什么? - What is the easiest way to use DAO Engine (Access) in Python for a complete application? 如何将数据从Google App Engine(Python)传递到Flex 4应用程序 - How to pass data from Google App Engine(Python) to Flex 4 application 在Python中从文件加载数组数据的最简单方法是什么? - what's the easiest way to load array data from a file in Python? 如何在本地运行python +谷歌应用程序引擎应用程序,但指向实时谷歌数据存储? - How to run python + google app engine application locally but pointing to live google datastore? Google App Engine-Google App Engine开发环境和应用程序环境有什么区别 - Google app engine - What is the different between google app engine dev environment and application environment Google App Engine:从数据库检索数据 - Google App Engine: Retrieving data from database 在谷歌应用引擎(python)中实时更新图表 - Live updating charts in google app engine (python) 在Google App Engine上使用Twitter应用程序的正确方法是什么? - What's the correct approach for a Twitter Application on Google App Engine? Google App Engine实时更新(Python) - Google App Engine Live Updates (Python)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM