如何直接显示web2py错误(自动重定向到票证)

时间:2011-08-17 11:29:35

标签: web2py

在开发web2py应用程序时,它很常见,有各种语法错误,数据库问题等等。

但是,在调试这些问题时(在非生产系统中),默认情况下会显示故障单链接,而不是实际故障单。

有没有办法自动重定向到实际票证,无需点击(并等待实际票证加载)?

1 个答案:

答案 0 :(得分:5)

尝试在/web2py/routes.py文件中添加以下内容:

error_message_ticket='''
  <html><head>
    <script language="javascript">
      location.replace("/admin/default/ticket/%(ticket)s")
    </script>
    <!-- this is junk text else IE does not display the page: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //-->
  </head></html>'''

有关详情,请参阅在线图书中的Routes on Error