如何查看Django视图的错误日志 [英] How can I see error logs of Django views
问题描述
我如何看到我的意见的错误日志?
默认情况下,Django不会向控制台打印任何错误。相反,它提供非常有用的错误页面,显示您的视图中发生的任何错误。请检查您的 DEBUG
设置是否设置为。在开发中,这应该是 True
,这将为404和500错误提供不错的错误页面。
错误页面将如下所示:
django错误页面http ://linkaider.com/wp-content/uploads/2009/12/django-error.jpg
我也可以推荐一下 Heck Went错误? 从DjangoCon2009为有关django的基本调试技术的更多信息。
I'm coding a small application with Django. But I can't see any error logs in the console when an error (e.g. Python syntax error, etc.) occurs in one of my views -no action at all.
How can I see the error logs of my views? Debugging like a blind is really annoying.
Django does not print any errors to the console by default. Instead it provides very helpful error pages that are displayed for any errors that occur in your views. Please check what your DEBUG
setting is set to. In development this should be True
which will give you the nice error pages for 404 and 500 errors.
The pretty error page will look like this: django error page http://linkaider.com/wp-content/uploads/2009/12/django-error.jpg
I can also recommend the talk What the Heck Went Wrong? from DjangoCon2009 for some more information on basic debugging technics with django.
这篇关于如何查看Django视图的错误日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!