当前位置:网站首页>Error: flask: TypeError: 'function' object is not iterable

Error: flask: TypeError: 'function' object is not iterable

2022-08-09 06:27:00 Koala Rice Bowl

Error:
TypeError: 'function' object is not iterable
TypeError: means 'function' object is not iterable

This is what I'm learningIn the html template of flask, there is a missing () when the for loop traverses the flash message, resulting in the traversal object being a function;
Error code:

{% for messages in get_flashed_messages %}{{ messages}}{% endfor %}

Edit to:

{% formessages in get_flashed_messages() %}{{ messages }}{% endfor %}
原网站

版权声明
本文为[Koala Rice Bowl]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208090622259342.html