title: Playing Video with Django and html5 tag
body: <p>I am trying to play a video by using django with html5 video tag but couldn't.<br/>
  The main problem is that the server cannot get a <code>video</code> file.<br/>
  I got this error:</p>
  
  <pre><code>[06/Jan/2014 23:52:07] "GET absolute_path_of_media/sample.mp4 HTTP/1.1" 404 2422
  </code></pre>
  
  <p>and in inspect elements:</p>
  
  <p><img src="https://i.stack.imgur.com/mVvmO.png" alt="get error"></p>
  
  <p>Here, I will show you my code.<br/>
  templates/videoplay.html:</p>
  
  <pre><code>{% extends "app/base.html" %}
  {% block contents %}
  &lt;video name='demo' controls autoplay width='50%' height='40%'&gt;
  &lt;source src="{{media}}/sample.mp4" type="video/mp4"&gt;&lt;/source&gt;
  &lt;/video&gt;
  {% endblock %}
  </code></pre>
  
  <p>views.py:</p>
  
  <pre><code>def index(request):
      return render(request, "app/videoplay.html", {'media': MEDIA_ROOT}) 
  </code></pre>
  
  <p>I imported <code>MEDIA_ROOT</code> from settings.py and it is absolute path of media directory.</p>
  
  <p>develop environment:</p>
  
  <pre><code>browser: chrome 
  django:1.6.1
  python:2.7
  </code></pre>
  
  <p>static and media directories' relation:</p>
  
  <pre><code>mysite/
        static/
              sample.mp4
        media/
              sample.mp4
        templates/
              ....
        views.py
        ....
  </code></pre>