def __getstate__(self):
        obj_dict = super(TemplateResponse, self).__getstate__()

        del obj_dict['_request']
        del obj_dict['_current_app']

        return obj_dict
Provide something sane to print.
dataset/ETHPy150Open adieu/django-nonrel/django/template/response.py/TemplateResponse.__getstate__--crossover with--dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/sandbox/nonparametric/kernel_extras.py/SingleIndexModel.__repr__