$ pip install flask
app.py
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "Hello, World!"
I'm importing the Flask class from the flask package with from flask import Flask
.
You can set the route as you like with @ app.route ("/ ")
.
$ export FLASK_APP=app.py
$ flask run
Web application development "first step" with VS Code and Flask
Recommended Posts