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'])
|
||||
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)
|
||||
def not_found(error):
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<div class="container">
|
||||
<h2>Welcome to GrocList<h2>
|
||||
<br>
|
||||
Hello {{ id }}
|
||||
<p>Click <a href="/list/"{{ id }}>List</a> to view shopping list</p>
|
||||
<p>Click <a href="/">here</a> to go home. </p>
|
||||
Hello {{ full_name }}
|
||||
<p>Click <a href="/list/{{ id }}">List</a> to view shopping list</p>
|
||||
<p>Click <a href="/">here</a> to logout. </p>
|
||||
</div>
|
||||
</body>
|
||||
<html>
|
||||
|
||||
Reference in New Issue
Block a user