Basic Web Page

To upload the data received by the Pi, an HTML server must be set up to pass the weather station information.

Image result for html server
from flask import Flask # imports the flask library
from flask import render_template # imports the flask render template
app = Flask(__name__) # sets to default name
app.debug = True

@app.route("/")
def hello(): # making a function called hello
 return render_template('hello.html', message="Hello World!") # passes to hello.html

if __name__ == "__main__": # if name is correct 
 app.run(host='0.0.0.0', port=8080) # initiates server at 0.0.0.0 on port 8080

Leave a comment