Why the HTML here? And I don't think you need to run `str(e)` since the `HttpResponseBadRequest` will cast it to a string. Also, if the exception message contains unicode you might get a UnicodeDecodeError here.