开发者

Returning Django exceptions in plain text

Errors caught by Django in DEBUG mode are returned in HTML-formatted code for browser display. I'd like to have those errors display in plain text 开发者_如何学Go(or JSON) instead. Is there a way to do that?


I think you could modify the templates found in this file: https://code.djangoproject.com/browser/django/trunk/django/views/debug.py

Change TECHNICAL_500_TEMPLATE, TECHNICAL_404_TEMPLATE, and EMPTY_URLCONF_TEMPLATE to display plaintext.


Not a direct solution, but perhaps throwing django-sentry into the mix would allow you to do something more with the errors reported? Im still new to it myself.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜