microblog2/app/views.py

22 lines
513 B
Python
Raw Normal View History

2012-12-16 08:26:19 +00:00
from flask import render_template
2012-12-16 08:24:07 +00:00
from app import app
@app.route('/')
@app.route('/index')
def index():
2012-12-16 08:26:19 +00:00
user = { 'nickname': 'Miguel' }
posts = [
{
'author': { 'nickname': 'John' },
'body': 'Beautiful day in Portland!'
},
{
'author': { 'nickname': 'Susan' },
'body': 'The Avengers movie was so cool!'
}
]
return render_template("index.html",
title = 'Home',
user = user,
posts = posts)