On Wednesday, 4 November 2015 20:51:53 UTC, sonu kumar wrote: > > class based views are as below > > class TagList(TemplateView): > > def get_context_data(self, **kwargs): > > ... > > qlist = QueList.as_view()(self.request, **kwargs) > print qlist > > ... > > > class QueListView(ListView): > def get_context_data(self, **kwargs): > > ... > > > When QuesList.as_view() is called then it produces The response content must > be rendered before it can be accessed . on *print qlist* line How to fix this > error and what's reason behind this? > >
Because a TemplateView returns a TemplateResponse, which needs to be rendered. See the docs: https://docs.djangoproject.com/en/1.8/ref/template-response/ Can you explain why you are doing this? What's the point of calling one view from another? There's almost certainly a better way to achieve what you want. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/245050f9-d198-4279-8164-8ebd7a9449ea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.