現象
GET /index HTTP/1.1" 500 內部服務器錯誤
return render_template(“index.html”) #調用模塊index
jinja2.exceptions.TemplateNotFound: index.html
沒有找到index.html文件
原因
由於reder_template查找目錄是在當前目錄中查找templates,我創建的templates文件夾不在當前目錄中,因此找不到index.html文件。
解決方法
此程序所在目錄下創建一個templates文件夾,將index,html文件放入其中即可。