16 lines
300 B
Python
16 lines
300 B
Python
# Switches to POST
|
|
|
|
from flask import Flask, render_template, request
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
@app.route("/")
|
|
def index():
|
|
return render_template("index.html")
|
|
|
|
|
|
@app.route("/greet", methods=["POST"])
|
|
def greet():
|
|
return render_template("greet.html", name=request.form.get("name", "world"))
|