logic for list and argument passing is working
This commit is contained in:
@@ -36,7 +36,9 @@ def login():
|
|||||||
|
|
||||||
@app.route("/list/<id>", methods=['GET'])
|
@app.route("/list/<id>", methods=['GET'])
|
||||||
def list(id):
|
def list(id):
|
||||||
return render_template("list.html", id=id)
|
get_user_record = db.user_info.find_one({"uuid": id},{"name": 1})
|
||||||
|
full_name = get_user_record["name"]
|
||||||
|
return render_template("list.html", full_name=full_name, id=id)
|
||||||
|
|
||||||
@app.errorhandler(404)
|
@app.errorhandler(404)
|
||||||
def not_found(error):
|
def not_found(error):
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<h2>Welcome to GrocList<h2>
|
<h2>Welcome to GrocList<h2>
|
||||||
<br>
|
<br>
|
||||||
Hello {{ id }}
|
Hello {{ full_name }}
|
||||||
<p>Click <a href="/list/"{{ id }}>List</a> to view shopping list</p>
|
<p>Click <a href="/list/{{ id }}">List</a> to view shopping list</p>
|
||||||
<p>Click <a href="/">here</a> to go home. </p>
|
<p>Click <a href="/">here</a> to logout. </p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<html>
|
<html>
|
||||||
|
|||||||
Reference in New Issue
Block a user