> class IndexView(generic.ListView):
> template_name = 'bbs/index.html'
> def get_context_data(self, **kwargs):
> context = super(IndexView, self).get_context_data(**kwargs)
> self.response_class.set_cookie('cookiecity', value='上海')
> return context
这里面报错。看意思我知道是没有绑定,但是不知道怎么绑定?谢谢
unbound method set_cookie() must be called with TemplateResponse instance as first argument (got str instance instead)