Creating a global function without passing to the template
@app.template_global('double')
def double(n):
return 2 * n
Jinja Usage`enter code here`
\{\{double(77)}}
Or
Creating a filter in jinja.
@app.template_filter('geo_stuff')
def hellome(a,b='dadadd'):
d=a+'it is jerry'
return d
jinja use
\{\{'foo'|geo_stuff}}