为什么不管怎么改,网页的内容不改变?
来源:5-2 flask入门
慕的地7209688
2018-08-31
这是代码:from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__' :
app.run(debug=True)
就是在@app.route('/')的‘/’后加什么,就会404报错,或者在return 'Hello World!'后加内容,在网页中也不显示内容。
cmd的内容:
C:\Users\Administrator\Desktop>python test_flask.py
* Serving Flask app "test_flask" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 118-883-086
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Detected change in 'C:\\Users\\Administrator\\Desktop\\test_flask.py', reload
ing
* Restarting with stat
* Debugger is active!
* Debugger PIN: 118-883-086
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
不能像课程里面老师在网页上改地址后能够显示内容。
1回答
-
NavCat
2018-09-01
ctl+c结束掉,重新启动呢?
00
Python操作三大主流数据库-MySQL+MongoDB+Redis
2024 学习 · 376 问题
相似问题