1fromflaskimportFlask 2 3app = Flask(__name__) 4 5@app.route("/") 6defhello_world(): 7return"<p>Hello World from Flask!</p>"
1exportFLASK_APP=flaskproj 2flask run --host=0.0.0.0 3# http://127.0.0.1:5000/ 4# if the file is named app.py or wsgi.py, you don’t have to set the FLASK_APP environment 5
Python/Flask (last edited 2021-06-18 13:58:37 by localhost)