summaryrefslogtreecommitdiff
path: root/wk9/lect/hello/app.py
blob: 7d310adce02a91111d4bb8606472e61e39bfa6bf (plain)
1
2
3
4
5
6
7
8
9
10
from flask import Flask, render_template, request

app = Flask(__name__)

@app.route("/",  methods=["GET", "POST"])
def index():
    if request.method == "POST":
        name = request.form.get("name")
        return render_template("greet.html", name=name)
    return render_template("index.html")