<!doctype html> <!-- This is a Jinja based template. To read more about Jinja, check https://jinja.palletsprojects.com/en/3.0.x/ --> <title>Message board</title> <body> <h4>Welcome to Pelle's Message board </h4> There are {{ messages|length }} messages on the board. </ br> <h4> Here are the last 10:</h4> <ul> {% for m in messages[-9:]|reverse %} <li> "{{m.content}}" <small>Posted on {{m.timestamp}} </small> <img src="{{ m.img_path }}" width="500"> </li> {% endfor %} </ul> <h4> Enter a new message</h4> <form action="/handle_message" method="post" enctype=multipart/form-data > <label >Your message:</label><br> <input type="text" name="msg"><br> <input type="file" name="file"><br> <input type="submit" value="Submit"> </form> </body> </html>