added flash

This commit is contained in:
2019-08-20 18:54:13 -05:00
parent a9e86fdaab
commit bb2b3c6d35
2 changed files with 16 additions and 15 deletions

View File

@@ -13,6 +13,12 @@
<a href="/login">Login</a>
</div>
<hr>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
{% block content %}{% endblock %}
</body>
</html>
</html>

View File

@@ -1,15 +1,10 @@
<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>
{% extends "base.html" %}
{% block content %}
<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>
</body>
{% endblock %}