diff --git a/app/routes.py b/app/routes.py index 69701e3..d486cc3 100644 --- a/app/routes.py +++ b/app/routes.py @@ -1,7 +1,19 @@ +from flask import render_template from app import app @app.route('/') @app.route('/index') def index(): - return "Hello, World!" + 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) diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..8bde2a8 --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,14 @@ + +
+ {% if title %} +{{ post.author.username }} says: {{ post.body }}