【发布时间】:2021-08-31 12:58:28
【问题描述】:
代码没有显示任何错误,但在输出端口,即http://127.0.0.1:5000/显示内部服务器错误。
这是我的代码
from flask import Flask,render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/about')
def virtualization():
return render_template('about.html')
@app.route('/services')
def service():
return render_template('services.html')
if __name__ == '__main__':
app.run(debug=True)
在输出端
* Serving Flask app 'app' (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 264-698-791
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
【问题讨论】:
-
不要发布图片,而是使用 ctrl+k 代码过滤器发布代码。这也不是真正的错误使用调试模式
app.run(debug=True) -
调试模式开启,你能告诉我代码有什么问题吗?
-
我在代码中没有看到任何错误,可能发生了其他事情,你能把来自github的代码给我吗。
标签: python python-3.x flask web-applications