title: Pdf in django-rest-framework
body: <p>I am trying to make pdf  in Django</p>
  
  <pre><code> from xhtml2pdf import pisa
   from django.http import HttpResponse
   from django.template.loader import get_template
   from django.template import Context 
   from rest_framework.views import APIView
   from .models import Brand
  
   class ABCView(APIView):
     def post(self, request,format=None):
      report = Brand.objects.all()
      template_path = 'profile_brand_report.html'
  
      response = HttpResponse(content_type='application/pdf')
      response['Content-Disposition'] = 'attachment; filename="Report.pdf"'
  
      context = {'report': report}
      template = get_template(template_path)
      html = template.render(Context(context))
      print (html)
  
      pisaStatus = pisa.CreatePDF(html, dest=response)
  
      return response
  </code></pre>
  
  <p>but I am getting an unexpected error I don't know what I am doing wrong, I am getting this error</p>
  
  <pre><code>argument of type 'Context' is not iterable
  </code></pre>
  
  <p>or is there any other way to do it .thanks for help in advance</p>