请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

为什么不管怎么改,网页的内容不改变?

这是代码: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)

不能像课程里面老师在网页上改地址后能够显示内容。

正在回答 回答被采纳积分+3

1回答

NavCat 2018-09-01 21:28:11

ctl+c结束掉,重新启动呢?

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号