Самый простой способ получить быстрое решение - это gae-rest , но оно так же стара, как и 2008 год. Возможно, вам поможет мое решение, которое переводит мои данные в шаблон GeoRSS, поэтому вот мое решение:
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
<title>{{host}}</title>
<link href="http://{{host}}" rel="self"/>
<id>http://{{host}}/</id>
<updated>2011-09-17T08:14:49.875423Z</updated>
<generator uri="http://{{host}}/">{{host}}</generator>
{% for ad in ads %}
<entry>
<title><![CDATA[{{ad.title}}]]></title>
<link href="http://{{host}}/vi/{{ad.key.id}}"/>
<id>http://{{host}}/vi/{{ad.key.id}}</id>
<updated>{{ad.modified.isoformat}}Z</updated>
<author><name>{{ad.title|escape}}</name></author>
<georss:point>{{ad.geopt.lon|floatformat:2}},{{ad.geopt.lat|floatformat:2}}</georss:point>
<published>{{ad.added}}</published>
<summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">{{ad.text|escape}}</div>
</summary>
</entry>
{% endfor %}
</feed>
Обработчик:
class GeoRSS(webapp2.RequestHandler):
def get(self):
start = datetime.datetime.now() - timedelta(days=60)
count = (int(self.request.get('count'
)) if not self.request.get('count') == '' else 1000)
try:
ads = memcache.get('ads')
except KeyError:
ads = Ad.all().filter('modified >',
start).filter('published =',
True).order('-modified').fetch(count)
memcache.set('ads', ads)
template_values = {'ads': ads, 'request': self.request,
'host': os.environ.get('HTTP_HOST',
os.environ['SERVER_NAME'])}
dispatch = 'templates/georss.html'
path = os.path.join(os.path.dirname(__file__), dispatch)
output = template.render(path, template_values)
self.response.headers["Cache-Control"] = "public,max-age=%s" % 86400
self.response.headers['Content-Type'] = 'application/rss+xml'
self.response.out.write(output)