#!/usr/bin/env python # From: https://towardsdatascience.com/python-webserver-with-flask-and-raspberry-pi-398423cc6f5d ''' Code created by Matt Richardson for details, visit: http://mattrichardson.com/Raspberry-Pi-Flask/inde... ''' from flask import Flask, render_template import datetime app = Flask(__name__) @app.route("/") def hello(): now = datetime.datetime.now() timeString = now.strftime("%Y-%m-%d %H:%M") templateData = { 'title' : 'HELLO!', 'time': timeString } return render_template('index1.html', **templateData) if __name__ == "__main__": app.run(host='0.0.0.0', port=8080, debug=True)