Python 运行flask web app时出现内部服务器错误500

Python 运行flask web app时出现内部服务器错误500,python,html,flask,Python,Html,Flask,内部服务器错误 服务器遇到内部错误,无法完成您的请求。服务器过载或应用程序中存在错误 烧瓶应用程序代码为: from flask import Flask, render_template import numpy as np app = Flask(__name__) @app.route('/') def home(): return render_template("index1.html") if __name__ == "__main__": app.run(debug

内部服务器错误

服务器遇到内部错误,无法完成您的请求。服务器过载或应用程序中存在错误

烧瓶应用程序代码为:

from flask import Flask, render_template
import numpy as np
app = Flask(__name__)
@app.route('/')
def home():
    return render_template("index1.html")
if __name__ == "__main__":
   app.run(debug = True)
index1.html是:

<html>
<body>
<h1>This is index page...</h1>
</body>
</html>

这是索引页。。。

烧瓶需要一定的结构。所有模板(html文件)都需要位于目录
templates
中。所以,我假设你目前的结构是这样的

project/
|- app.py
|- index1.html
对吗?换成这个

project/
|- templates/
|  |- index1.html
|- app.py

控制台上的错误告诉您什么?有关控制台中错误消息的更多详细信息将非常有用控制台中没有错误只是警告,问题现在已解决。