In my Flask application, in main.py file, I defined:
from flaskext.babel import gettext
....
def somefun():
return render_template('some.html', messages=messages)
in template file some.html, I used:
<input type='text' name='keywords' value='{{ keywords|default('') }}' placeholder='{{ gettext('Search...') }}' />
This gives an error:
<input type='text' name='keywords' value='{{ keywords|default('') }}' placeholder='{{ gettext('Search...') }}' />
UndefinedError: 'gettext' is undefined
How to import this function for template use?