请检查下面几点:
1、项目下面要有templates文件夹,html文件要放进里面;
2、templates文件夹要和运行的py文件在同一级目录;
3、render_template('***.html')这里面的名字要正确;
4、app = Flask(__name__, template_folder='templates') template_folder必须是templates;
5、static为静态资源文件夹,必须跟templates同一级位置
Python与Flask的NotFound最快速的解决办法
于 2023-05-14 11:30:58 首次发布