From 69e9166b3f6d08d80ceec0b1f6d790abb59a2466 Mon Sep 17 00:00:00 2001 From: grb <473602668@qq.com> Date: Fri, 4 Aug 2017 20:39:45 -0700 Subject: [PATCH] add comment for app.py form.html --- samples/web/mvc/app.py | 4 ++-- samples/web/mvc/templates/form.html | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/samples/web/mvc/app.py b/samples/web/mvc/app.py index 3431919e..c7cac0eb 100755 --- a/samples/web/mvc/app.py +++ b/samples/web/mvc/app.py @@ -18,8 +18,8 @@ def signin(): username = request.form['username'] password = request.form['password'] if username=='admin' and password=='password': - return render_template('signin-ok.html', username=username) - return render_template('form.html', message='Bad username or password', username=username) + return render_template('signin-ok.html', username=username) # 这里我们向signin-ok.html传递了一个它需要替换的参数 + return render_template('form.html', message='Bad username or password', username=username) # 这里也传递了一个 if __name__ == '__main__': app.run() diff --git a/samples/web/mvc/templates/form.html b/samples/web/mvc/templates/form.html index 316092ac..cb21e108 100644 --- a/samples/web/mvc/templates/form.html +++ b/samples/web/mvc/templates/form.html @@ -3,9 +3,12 @@
{{ message }}
{% endif %} + +