views.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:pygameweb 作者: pygame 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号