方法一:

一度喜欢tornado的我, 一直在尝试寻找自定义404的方法,恰巧在看tornaod的mvc结构的时候看到了解决办法

方法之巧妙令人从心底佩服。后来我克隆一份到自己的github以作备份。

地址是:https://github.com/renfanzi/tornado-mvc

但有个代码地方不太明白: 就是define("env")这里, 这个debug(。。。。)这块的作用是什么, 如果知道的还请留言告知!

 原文链接:http://www.tuicool.com/articles/6jUnauJ, 讲述的是tornado的mvc框架

方法二:

tornado.web.RequestHandler.write_error = write_error

 

def write_error(self, stat, **kw):
    self.write('访问url不存在!')

哈哈哈

 

 

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
猜你喜欢
  • 2021-09-02
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2021-09-25
  • 2022-12-23
相关资源
相似解决方案