示例#1
0
文件: web.py 项目: dmc2015/mpt
def index():
    context = {
        'posts': feeds.posts(),
        'mpt_tweets': twitter.mpt_timeline(per_page=1),
        'tag_tweets': twitter.tag_timeline(per_page=2),
    }
    return render_template('index.html', **context)
示例#2
0
文件: web.py 项目: dmc2015/mpt
def feed():
    posts = feeds.posts()
    context = {
        'posts': posts,
        'now': datetime.datetime.utcnow(),
    }
    resp = Response(render_template('feed.xml', **context))
    resp.headers['Content-Type'] = 'application/rss+xml'
    return resp