def __call__(self, request): local.request = request request.request_id = local.get_http_request_id() response = self.get_response(request) response['X-Request-Id'] = request.request_id local.release() return response
def process_request(self, request): local.request = request request.request_id = local.get_http_request_id()