Hello, all. I am having a weird issue with Flask's render_template function.
I had used Flask in the past for a basic project and I am just getting into it again. I have pulled my hair out since last night and I can not get this working. Thanks in advance for your guidance!
from flask import Flask, render_template
app = Flask(__name__)
app.config["DEBUG"] = True
@app.route('/')
def hello_world():
return 'Hello from Flask!'
@app.route('/properties')
def properties():
age = 45
return render_template('properties_list.html', age=age)
I am using {{age}} in the properties_list.html page but the value never appears. If I try to use math on it (if less than), the page does not render and I get an error in the log that age is not defined. "jinja2.exceptions.UndefinedError: 'age' is undefined"