title: get <audio> </audio> to play an mp3 file in an HTTPresponse in django
body: <p>I'm making a django app that basically saves any mp3 file you upload and creates a model for it. Then, when you select a song from a list, you call a view that generates the HTML required play the selected mp3 file:</p>
  
  <pre><code>def playAudioFile(request, title):
      fname= os.path.join(BASE_DIR, 'upandplay/songdir/' + title + '.mp3')
      f = open(fname,"rb") 
      response = HttpResponse(f.read())
      response['Content-Type'] ='audio/mp3'
      response['Content-Length'] = os.path.getsize(fname )
      return render(request, 'playlist.html', {'response': response})
  </code></pre>
  
  <p>My html template looks like this:</p>
  
  <pre><code>{% extends 'index.html' %}
  
  {% block content %}
  
  &lt;div class='row'&gt;
  
          {{response}}
  
  &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  
  <p>I get redirected to the right url but the song doesn't play. How can I get the song to play?</p>
  
  <p>Thanks so much beforehand.</p>