code: def get(self, request, *args, **kwargs):
          
          if 'html' in request.GET:
              # Output HTML
              content = self.render_html(*args, **kwargs)
              return HttpResponse(content)
  
          else:
              # Output PDF
              content = self.render_pdf(*args, **kwargs)
  
              response = HttpResponse(content, content_type='application/pdf')
  
              if (not self.inline or 'download' in request.GET) and 'inline' not in request.GET:
                  response['Content-Disposition'] = 'attachment; filename=%s' % self.get_filename()
  
              response['Content-Length'] = len(content)
  
              return response
docs: Return a HTTPResponse either of a PDF file or HTML.
  
          :rtype: HttpResponse