Added DEBUG_PLAINTEXT_AJAX_ERROR_MESSAGES setting to customize error display #8

Closed
wants to merge 1 commit into
from
View
4 django/views/debug.py
@@ -59,7 +59,9 @@ def technical_500_response(request, exc_type, exc_value, tb):
the values returned from sys.exc_info() and friends.
"""
reporter = ExceptionReporter(request, exc_type, exc_value, tb)
- if request.is_ajax():
+
+ plaintext = request.is_ajax() and getattr(settings, 'DEBUG_PLAINTEXT_AJAX_ERROR_MESSAGES', True)
+ if plaintext:
text = reporter.get_traceback_text()
return HttpResponseServerError(text, mimetype='text/plain')
else: