Пример #1
0
    def GET(self):
        import PyRSS2Gen as RSS2

        posts = Post.all().filter('active =', True).order('-datetime')
        items = list()
        for post in posts:
            link = SITE_URL+'/post/'+post.slug+'-'+str(post.key().id())
            items.append(
                RSS2.RSSItem(
                    title = post.title,
                    link = link,
                    description = post.body.split('\n')[0],
                    guid = RSS2.Guid(link),
                    pubDate = post.datetime))
            
            rss = RSS2.RSS2(
                title = "Sibande's feed",
                link = SITE_URL,
                description = "Random thoughs by Sibande_",
                lastBuildDate = datetime.datetime.now(),
                
                items = items)

        return rss.to_xml();
Пример #2
0
    def GET(self):
        context['posts'] = Post.all().filter('active =', True).order('-datetime')

        return render_template('index.html', **context)