added loops to index

This commit is contained in:
2019-08-20 18:44:15 -05:00
parent a0d4899cd7
commit a9e86fdaab
3 changed files with 17 additions and 3 deletions

View File

@@ -7,7 +7,11 @@
{% endif %}
</head>
<body>
<div>Microblog: <a href="/index">Home</a></div>
<div>
Microblog:
<a href="/index">Home</a>
<a href="/login">Login</a>
</div>
<hr>
{% block content %}{% endblock %}
</body>

View File

@@ -1,8 +1,15 @@
<html>
<head>
{% if title %}
<title>{{ title }} - Microblog</title>
{% else %}
<title>Welcome to Microblog</title>
{% endif %}
</head>
<body>
<h1>Hello, {{ user.username }}!</h1>
{% for post in posts %}
<div><p>{{ post.author.username }} says: <b>{{ post.body }}</b></p></div>
{% endfor %}
</body>
</html>