The following is an attempt to create a custom filter to identify the mistake.
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def home():
return render_template("home.html")
@app.template_filter('half_of')
def half(num):
return int(num)/2
if __name__ == '__main__':
app.run()
Where home.html is a template that contains {{ 3 | half }}.
Can you tell what's wrong?