开发者

How can I see error logs of Django views

开发者 https://www.devze.com 2022-12-17 18:00 出处:网络
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.

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 annoyin开发者_如何学运维g.


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:

How can I see error logs of Django views


(source: linkaider.com)

I can also recommend the talk What the Heck Went Wrong? from DjangoCon2009 for some more information on basic debugging technics with django.

0

精彩评论

暂无评论...
验证码 换一张
取 消