From 42af137408e6e51f92d71f3195206c5ce990f0f0 Mon Sep 17 00:00:00 2001 From: zart2007 Date: Mon, 17 Apr 2023 15:02:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 2 +- templates/hello.html | 10 +++++----- templates/index.html | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 templates/index.html diff --git a/app.py b/app.py index e6d4d38..b03dd88 100644 --- a/app.py +++ b/app.py @@ -23,4 +23,4 @@ def hello_2(name): if __name__ == '__main__': - app.run(host="127.0.0.1", port=8080, debug=True) \ No newline at end of file + app.run(host="0.0.0.0", port=8080, debug=True) \ No newline at end of file diff --git a/templates/hello.html b/templates/hello.html index 86d7d9b..7cdb4f1 100644 --- a/templates/hello.html +++ b/templates/hello.html @@ -5,11 +5,11 @@ Hello from flask -{% if name %} -

hello {{ name }}!

-{% else %} -

Hello World!

-{% endif %} + {% if name %} +

hello {{ name }}!

+ {% else %} +

Hello World!

+ {% endif %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..2c949f3 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,14 @@ + + + + + Hello from Flask + + +{% if name %} +

Hello {{ name }}

+{% else %} +

Hello World!

+{% endif %} + + \ No newline at end of file