From b3a2a725b8f036194196fba34e9fd1fde0580124 Mon Sep 17 00:00:00 2001 From: nglk Date: Tue, 8 Sep 2020 16:00:47 +0200 Subject: [PATCH] made first minimal flask --- __pycache__/hello.cpython-36.pyc | Bin 0 -> 560 bytes hello.py | 14 ++++++++++++++ index.html | 0 templates/hello.html | 7 +++++++ 4 files changed, 21 insertions(+) create mode 100644 __pycache__/hello.cpython-36.pyc create mode 100644 hello.py delete mode 100644 index.html create mode 100644 templates/hello.html diff --git a/__pycache__/hello.cpython-36.pyc b/__pycache__/hello.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4939ebdb6457473c703ce2921c3f4ae4a41f3103 GIT binary patch literal 560 zcmYk2&q~8U5XN^lNxSxsf={5wf*4V}sR)YnR0M@WE=%mLHo8g5CTX#FtJgk=uav7N zU!f;wwo1EUXFhgkzxid(y4{vo4&^Q|_RY3dfchGD@rXe&1%{;%0g&dXdBlNf(B1+f zU;D3tLZy5ad@?*~xRb^LTyEk`TkWXUCoJ%bno2ydUgrm$Sr6*q&cwwViao0{rL8P= zIx%snR}hY<=6@k0yTM)f7!;rfAI!UbZA^Z2FwCt{hhNMR`6jF`!*QPKFwS1IN#2t1 zHXl`~&dMS@Jvlj-{r4xED0yE!nWPve*-JQ`PG{kmOphn;b=xU9BliaN<`@{aO^oyA zx-Oh||HMTWr}}CzB2rqE3D!|}P?X61ffHPEr1u8%*1FNSObrger{_Je9#&!!m^Oc6 zseK)|2W^yV63_0q;z3W;!7~lg5}~uGg_PtdW$ne2Ngdd{Dz!s*ueQA1&|Cv?k>;v0 S`ij^KV(vhP3%(x+5bz76i+Gp- literal 0 HcmV?d00001 diff --git a/hello.py b/hello.py new file mode 100644 index 0000000..c670fde --- /dev/null +++ b/hello.py @@ -0,0 +1,14 @@ +from flask import Flask +from flask import render_template + +app = Flask(__name__) + +@app.route('/') +def hello_world(): + return 'Hello, World!' + + +@app.route('/hello/') +@app.route('/hello/') +def hello(name=None): + return render_template('hello.html', name=name) diff --git a/index.html b/index.html deleted file mode 100644 index e69de29..0000000 diff --git a/templates/hello.html b/templates/hello.html new file mode 100644 index 0000000..b96b4fb --- /dev/null +++ b/templates/hello.html @@ -0,0 +1,7 @@ + +Hello from Flask +{% if name %} +

Hello {{ name }}!

+{% else %} +

VVVW

+{% endif %}