﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24619	Technical error responses (404 and 500) should return responses dependent on Accept header	Marcin Nowak	nobody	"Technical error responses are used in DEBUG mode only and they aren't customizable.
In most cases they are resulting HTML output, but plain text only for AJAX-like requests (based on `request.is_ajax()` return value).

As a developer who is creating views/services non HTML-related (JSON, XML, etc as a response) I have huge problems with reading output from technical responses when error occurs. I'm getting in my console or shell HTML mixed with Javascript and CSS, which is hard to read. Text output from technical responses is hard-readable too, but better than HTML.

Technical responses should use some sort of output renderers registry based on `Accept` header. They should implement or use content type negotiation strategy and match against available renderers. Current HTML and text output can be mapped for `text/html` and `text/plain` types respectively. Also as a developer I need to extend registry of supported content types for my specific needs. For example - I need error 500 technical response returned as `application/json` content-type. Django can provide some builtin technical output renderes.

Optionally content-type negotiation functionality can be built as a standalone helper for common use.

--------

Extracted from #24610

"	Uncategorized	new	Core (Other)	dev	Normal				Unreviewed	0	0	0	0	0	0
