def atom():
""" of the news page.
"""
resp = render_template('news/atom.xml', news=latest_news(current_session))
response = make_response(resp)
response.headers['Content-Type'] = 'application/atom+xml; charset=utf-8; filename=news-ATOM'
return response
# This makes output which crashes a feed validator.
# from werkzeug.contrib.atom import AtomFeed
# news=latest_news(current_session)
# feed = AtomFeed('pygame news', feed_url=request.url, url=request.url_root)
# for new in news:
# feed.add(new.title, new.description_html,
# content_type='html',
# author='pygame',
# url='https://www.pygame.org/news.html',
# updated=new.datetimeon,
# published=new.datetimeon)
# return feed.get_response()
评论列表
文章目录