microblog/app/routes.py

20 lines
472 B
Python
Raw Normal View History

2017-09-05 06:28:11 +00:00
from flask import render_template
2017-09-05 06:23:07 +00:00
from app import app
@app.route('/')
@app.route('/index')
def index():
2017-09-05 06:28:11 +00:00
user = {'username': 'Miguel'}
posts = [
{
'author': {'username': 'John'},
'body': 'Beautiful day in Portland!'
},
{
'author': {'username': 'Susan'},
'body': 'The Avengers movie was so cool!'
}
]
return render_template('index.html', title='Home', user=user, posts=posts)