views:

42

answers:

1

i want enable rss for gae on my site .

and did you know the simple way to do this ?

thanks

this is a example i searched:

class FeedHandler(BaseRequestHandler):
    def get(self,tags=None):
        blogs = Weblog.all().filter('entrytype =','post').order('-date').fetch(10)
        last_updated = datetime.datetime.now()
        if blogs and blogs[0]:
            last_updated = blogs[0].date
            last_updated = last_updated.strftime("%Y-%m-%dT%H:%M:%SZ")
        for blog in blogs:
            blog.formatted_date = blog.date.strftime("%Y-%m-%dT%H:%M:%SZ")
        self.response.headers['Content-Type'] = 'application/atom+xml'
        self.generate('atom.xml',{'blogs':blogs,'last_updated':last_updated})

any more simple ?

+1  A: 

Have a look to PyRSS2Gen.
You could find many examples of self-made python blogs on Google appengine that generate RSS 2.0 feed using PyRSS2Gen.
Here and Here some good examples.

systempuntoout