Refactoring between 3.3.3 and 3.4.0 changed how Response.render passes media_type to its renderer.
Response sets it as media_type = renderer.media_type compared to self.accepted_media_type (set via APIView.finalize_response here).
Since renderer.media_type looses the indent parameter (i.e. application/json; indent=4 becomes application/json), the resulting JSON rendering is not indented.
A 'simple' fix is to restore the 3.3.3 code where media_type = getattr(self, 'accepted_media_type', None) but I haven't made a PR yet because I'm not clear as to whether there was a specific reason for changing to renderer.media_type (which might have overlooked that it doesn't include indent).
Refactoring between 3.3.3 and 3.4.0 changed how
Response.renderpassesmedia_typeto itsrenderer.Response sets it as
media_type = renderer.media_typecompared toself.accepted_media_type(set viaAPIView.finalize_responsehere).Since
renderer.media_typelooses the indent parameter (i.e.application/json; indent=4becomesapplication/json), the resulting JSON rendering is not indented.A 'simple' fix is to restore the 3.3.3 code where
media_type = getattr(self, 'accepted_media_type', None)but I haven't made a PR yet because I'm not clear as to whether there was a specific reason for changing torenderer.media_type(which might have overlooked that it doesn't includeindent).