i followed the instructions very closely. When i do enter a name it works just fine. However, when i do not enter it, "world" did not show up. only the "hello, " part. This was fine before i use the template. I rerun flask, still same thing. I tried to clear cookies too.
layout.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="intial-scale=1,width=device-width">
<title>hello</title>
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>
index.html
{% extends "layout.html" %}
{% block body %}
<form action="/greet" method="get">
<input autocomplete="off" autofocus name="name" placeholder="Name" type="text">
<button type="submit">Greet</button>
</form>
{% endblock %}
greet.html
{% extends "layout.html" %}
{% block body %}
hello, {{ name }}
{% endblock %}
app.py
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/greet")
def greet():
name = request.args.get("name","world")
return render_template("greet.html",name=name)