Django Book 翻译
菜单>:
TOC
返回
原文:
Are you the type of programmer who likes to debug with the help of carefully placed ``print`` statements? You can use the Django error page to do sojust without the ``print`` statements. At any point in your view, temporarily insert an ``assert False`` to trigger the error page. Then, you can view the local variables and state of the program. (Theres a more advanced way to debug Django views, which well explain later, but this is the quickest and easiest.)
翻译:
不知道你是不是那种使用小心放置的 ``print`` 语句来帮助调试的程序员?你其实可以用 Django 出错页来做这些,而不用 ``print`` 语句。在你视图的任何位置,临时插入一个 ``assert False`` 来触发出错页。然后,你就可以看到局部变量和程序语句了。(还有更高级的办法来调试 Django 视图,我们后来再说,但这个是最快捷最简单的办法了。)
备注:
译者: