diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..0fbd92f --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,14 @@ + +
+ {% if title %} ++ {{post.author.nickname}} says: {{post.body}} +
+{% endfor %} +{% endblock %} \ No newline at end of file diff --git a/app/views.py b/app/views.py index d467b15..7742496 100644 --- a/app/views.py +++ b/app/views.py @@ -1,6 +1,21 @@ +from flask import render_template from app import app @app.route('/') @app.route('/index') def index(): - return "Hello, World!" + 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)