title: Having trouble integrating BIRT with Python Django
body: <p>I am trying to integrate BIRT with Python Django. I created a form in Django that lets the user input parameters to a report. When the form is submitted, the view takes the parameters and creates a request and sends it to the BIRT Tomcat server. Now I am trying to render the response from the server. This is what I have in my view:</p>
  
  <pre><code>def birt_report(request, report_id, report_url=None, template='report_parameters.html'):
      if request.method == 'POST':
          form = ReportParametersForm(request.POST)
          if form.is_valid():
              report_params = form.save()
              form_id = report_params.id
              url = "http://&lt;hostname&gt;/BIRT-Viewer/frameset?__report=" + report_url + ".rptdesign"
              url += "&amp;param_id=" + str(form_id)
              r = requests.get(url)
              return HttpResponse(content=str(r.content),status=200,content_type='text/html; charset=utf-8')
      else:
          form = ReportParametersForm()
          return render(request,template, {
              'form': form,
              'report_url': report_url,
              'report_id': report_id,
          })
  </code></pre>
  
  <p>Everything works up to the point where I try to render what the BIRT server sends back to me. I get the default BIRT web app toolbar. However, the report part of the page is blank. Here's what it looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/4FFsZ.png" alt="BIRT-report"></p>
  
  <p>The report gets generated properly in my Eclipse Report Designer preview. How do I get the report to render here? Thanks!</p>
  
  <p>Edit:</p>
  
  <p>I took a look at what was going on when the page was loading and I get this error in my Javascript console:</p>
  
  <pre><code>POST http://&lt;hostname&gt;/&lt;Django_URL&gt;/__sessionId=20130410_103510_658?__sessionId=20130410_103510_658 404 (NOT FOUND)
      prototype.js:656
  Ajax.Request.Object.extend.request
      prototype.js:656
  Ajax.Request.Object.extend.initialize
      prototype.js:631
  (anonymous function)
      prototype.js:24
  BirtCommunicationManager.connect
      BirtCommunicationManager.js:58
  BirtEventDispatcher.sendEvent
      BirtEventDispatcher.js:179
  BirtEventDispatcher.broadcastEvent
      BirtEventDispatcher.js:141
  Object.extend.__init_pag
  e    BirtNavigationBar.js:243
  init
      &lt;hostname&gt;:1604
  onload
      &lt;hostname&gt;:91
  </code></pre>
  
  <p>When I go to the report via the BIRT Viewer webapp that is included with BIRT, the Javascript file [b]prototype.js:656[/b], uses this URL:</p>
  
  <pre><code>http://&lt;hostname&gt;/BIRT-Viewer/frameset?__report=&lt;report_name&gt;.rptdesign&amp;param_id=1&amp;__sessionId=20130410_103510_658
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>http://&lt;hostname&gt;/&lt;Django_URL&gt;/__sessionId=20130410_103510_658?__sessionId=20130410_103510_658
  </code></pre>