2011-08-17 49 views
5

當開發web2py應用程序時,它很常見,有各種語法錯誤,db問題等。如何直接顯示web2py錯誤(自動重定向到票證)

但是,在調試這些問題時(在非生產系統中),默認情況下會顯示故障單鏈接,而不是實際的故障單。

有沒有一種方法可以自動重定向到實際的故障單,而無需點擊(並等待實際的故障單加載)?

回答

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在網上預定。

+0

很好用!謝謝! – 2011-08-17 15:13:09

相關問題