方法一: 直接在run的时候添加debug

from flask import Flask
app = Flask(__name__) @app.route('/')
def hello_world():
return 'Hello Flask!' if __name__ == '__main__':
app.run(debug=True)

方法二: 添加配置文件

1 添加config.py

# encoding:utf-8
DEBUG = True

2 index.py 引入config

from flask import Flask
import config
app = Flask(__name__)
app.config.from_object(config) @app.route('/')
def hello_world():
return 'Hello Flask!' if __name__ == '__main__':
app.run()

查看效果:

浏览器 效果:

修改 index.py 并保存

刷新浏览器:

over!

最新文章

  1. HBase相关
  2. Oracle、SQL Server、MySQL分页方法
  3. Codeforces Gym 100650C The Game of Efil DFS
  4. 常用PHP框架功能对比表
  5. [LeetCode] 315. Count of Smaller Numbers After Self (Hard)
  6. 看个人思路吧,清晰的话就简单 CodeForces 271A - Beautiful Year
  7. WPC文件修改还原pin进度
  8. jQuery ajax在GBK编码下表单提交终极解决方案(非二次编码方法)(转)
  9. java代码发送JSON格式的httpPOST请求
  10. [HNOI2012]射箭
  11. 20160227.CCPP体系详解(0037天)
  12. Python报错:ImportError: No module named src.data_layer
  13. python 之 函数的参数
  14. Install OpenCV-Python in Ubuntu
  15. atmega328 熔丝
  16. sar监控工具详解
  17. PHP5.4新特性之上传进度支持Upload progress
  18. Qt+json
  19. 【PHP】 mysqli_autocommit() 函数
  20. Leecode刷题之旅-C语言/python-434 字符串中的单词数

热门文章

  1. C# wkhtmltopdf 将html转pdf
  2. C# 验证过滤代理IP是否有效
  3. Kong安装简介
  4. keep-alive pipeline区别
  5. 猫猫学iOS之小知识iOS启动动画_Launch Screen的运用
  6. eclipse中去掉validate的方法
  7. iOS开发异常处理教程
  8. 文字描边css
  9. ubuntu12.04 折腾流水
  10. Gulp--Less