title: How to show a PDF file in a Django view?
body: <p>Is it possible to show a PDF file <em>in</em> the Django view, rather than making the user have to download it to see it?</p>
  
  <p>And if it is possible, how would it be done?</p>
  
  <p>This is what I have so far - </p>
  
  <pre><code>@login_required
  def resume(request, applicant_id):
  
      #Get the applicant's resume
      resume = File.objects.get(applicant=applicant_id)
      fsock = open(resume.location, 'r')
      response = HttpResponse(fsock, mimetype='application/pdf')
  
      return response
  </code></pre>