def __getstate__(self):
        obj_dict = self.__dict__.copy()
        if not self._is_rendered:
            raise ContentNotRenderedError('The response content must be '
                                          'rendered before it can be pickled.')
        for attr in self.rendering_attrs:
            if attr in obj_dict:
                del obj_dict[attr]

        return obj_dict
Pickling support function.
dataset/ETHPy150Open django/django/django/template/response.py/SimpleTemplateResponse.__getstate__