search

Home  >  Q&A  >  body text

python - 怎样在linux下开发flask web应用时查看代码出错(traceback)的地方。

怎样在linux下开发flask web应用的时候可以向Windows一样通过cmd命令行查看到代码出错的地方。
Windows下:
1.通过cmd启动Lighttpd,打开网页调用flask web应用testwsgi.py,网页出现500 - Internal Server Error 在cmd查看错误信息。

2.通过linux执行开启Lighttpd服务后,打开网页调用flask web应用testwsgi.py,网页出现500 - Internal Server Error 没有地方可以看出程序出错的信息,怎么解决

天蓬老师天蓬老师2767 days ago615

reply all(3)I'll reply

  • 阿神

    阿神2017-04-18 10:25:11

    Have you turned on debugging mode

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 10:25:11

    app.run(debug=True)

    reply
    0
  • 高洛峰

    高洛峰2017-04-18 10:25:11

    There is no place to see program error information

    Yes. Error reports will be written to the error log. The specific file it is in depends on how you execute the WSGI program. lighttpd happens to be the one I don't know about...but if you haven't configured anything else, you can be sure that the errors are collected by lighttpd, just look at its error log.

    reply
    0
  • Cancelreply