title: Django: conditional 500 response depending on Accept header?
body: <p>Django returns an HTML error template by default when an unhandled exception happens in a view.  I would like to return a JSON response instead, if the request had an "Accept: 'application/json'" header (but otherwise return the usual HTML).  How might I do that?</p>