summaryrefslogtreecommitdiff
path: root/wk9/lect/hello/app.py
blob: 1c44a693991127ed57a06d3be784072cadfeb0da (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", "world")
        return render_template("greet.html", name=name)
    return render_template("index.html")