From c49f2aa4c23a4688049e28cc154fb1de93a4e8fa Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Tue, 9 Jul 2024 08:56:57 +0000 Subject: Tue, Jul 9, 2024, 1:56 AM -07:00 --- wk9/lect/hello/app.py | 7 ++++++- wk9/lect/hello/templates/greet.html | 11 +++++++++++ wk9/lect/hello/templates/index.html | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 wk9/lect/hello/templates/greet.html (limited to 'wk9/lect/hello') diff --git a/wk9/lect/hello/app.py b/wk9/lect/hello/app.py index 1368586..635671d 100644 --- a/wk9/lect/hello/app.py +++ b/wk9/lect/hello/app.py @@ -4,5 +4,10 @@ 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("index.html", name=name) + return render_template("greet.html", name=name) diff --git a/wk9/lect/hello/templates/greet.html b/wk9/lect/hello/templates/greet.html new file mode 100644 index 0000000..7e90e67 --- /dev/null +++ b/wk9/lect/hello/templates/greet.html @@ -0,0 +1,11 @@ + + + + + + hello + + + hello, {{ name }} + + diff --git a/wk9/lect/hello/templates/index.html b/wk9/lect/hello/templates/index.html index e7b6bec..4ce1e85 100644 --- a/wk9/lect/hello/templates/index.html +++ b/wk9/lect/hello/templates/index.html @@ -6,7 +6,7 @@ hello - +
-- cgit v1.2.3