class JSONIndentAcceptHeaderMiddleware(object):

    def process_request(self, request):
        request.META['HTTP_ACCEPT'] = 'application/json; indent=4'
        return None

class JSONIndentAcceptHeaderMiddleware(object):

    def process_request(self, request):
        if request.META.get('HTTP_ACCEPT') == 'application/json':
            request.META['HTTP_ACCEPT'] = 'application/json; indent=4'
        return None

Apply indenting to only requests that specify application/json accept headers
PI-248: Apply indenting to only requests that specify application/json accept
headers
