def __call__(self, request): set_current_request(request) try: response = self.get_response(request) finally: set_current_request(None) return response
def process_response(self, request, response): request.kb = None set_current_request(None) return response
def process_request(self, request): set_current_request(request)