AttributeError: can't set attribute
问题 I am working on a legacy django project, in there somewhere there is a class defined as follows; from django.http import HttpResponse class Response(HttpResponse): def __init__(self, template='', calling_context='' status=None): self.template = template self.calling_context = calling_context HttpResponse.__init__(self, get_template(template).render(calling_context), status) and this class is used in views as follows def some_view(request): #do some stuff return Response('some_template.html',