Попытка перенаправить мое веб-приложение на домашнюю страницу после отправки формы, но оно просто выдает запрос формы в адресной строке. Например / форма? Имя = input & Location = input
script.py
@app.route("/")
def home():
return render_template("index.html")
@app.route("/form", methods=["POST", "GET"])
def form():
if request.method == "GET":
return render_template("form.html")
else:
return redirect(url_for("home"))
form. html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form >
<input type="text" name="Name">
<input type="text" name="Location">
<input type="submit" value="submit">
</form>
</body>
</html>