diff --git a/.flaskenv.example b/.flaskenv.example new file mode 100644 index 0000000..a148227 --- /dev/null +++ b/.flaskenv.example @@ -0,0 +1 @@ +FLASK_APP=microblog.py \ No newline at end of file diff --git a/.gitignore b/.gitignore index 821cb3e..60ff444 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ instance/ # Flask specific webassets/ +/.flask.env diff --git a/app/routes.py b/app/routes.py index 1e492b0..a0f9021 100644 --- a/app/routes.py +++ b/app/routes.py @@ -1,5 +1,18 @@ +from flask import render_template from app import app + @app.route('/') @app.route('/index') def index(): - return "Hello, word!" \ No newline at end of file + 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) \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html new file mode 100644 index 0000000..2d78870 --- /dev/null +++ b/app/templates/base.html @@ -0,0 +1,15 @@ + + +
+ {% if title %} +{{ post.author.username }} says: {{ post.body }}