diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-07-09 09:20:41 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-07-09 09:20:41 +0000 |
commit | 308b08232f0282433905c7abe24e14080f41071b (patch) | |
tree | c5cd4c76246c1ed3d46deeff1e1828cfc7726ee1 | |
parent | 90ac834374afc01f7bd12fee9af7bc6b6156e65c (diff) |
Tue, Jul 9, 2024, 2:20 AM -07:00
-rw-r--r-- | wk9/lect/hello/app.py | 2 | ||||
-rw-r--r-- | wk9/lect/hello/templates/greet.html | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/wk9/lect/hello/app.py b/wk9/lect/hello/app.py index 1c44a69..7d310ad 100644 --- a/wk9/lect/hello/app.py +++ b/wk9/lect/hello/app.py @@ -5,6 +5,6 @@ app = Flask(__name__) @app.route("/", methods=["GET", "POST"]) def index(): if request.method == "POST": - name = request.form.get("name", "world") + name = request.form.get("name") return render_template("greet.html", name=name) return render_template("index.html") diff --git a/wk9/lect/hello/templates/greet.html b/wk9/lect/hello/templates/greet.html index e340324..f38174a 100644 --- a/wk9/lect/hello/templates/greet.html +++ b/wk9/lect/hello/templates/greet.html @@ -2,6 +2,6 @@ {% block body %} - hello, {{ name }} + hello, {% if name %}{{ name }}{% else %}world{% endif %} {% endblock %} |