I have created a session variable through the line session["Appointments"] = []
earlier on.
In another separate function, this is the Python
code. The print function returns a number that indicates a non-empty list.
@app.route("/Dashboard.html", methods=["GET", "POST"])
def Dashboard():
if request.method == "POST":
session["Appointments"].append(stuff)
print("Available appointments:", len(session["Appointments"]))
return render_template("Dashboard.html")
Below is part of the HTML
file. The desired outcome is a number that is not zero, but when running it is zero, representing an empty list.
{{ session["Appointments"]|length }}
I need to know why this is the case. Thank you ever so much in advance.