title: Playing uploaded video with Django
body: <p>I am not able to play video on my Django website. I think something is wrong in my views.py render function</p>
  
  <p>videoplay.html:</p>
  
  <pre><code>{% block contents %}
    &lt;video name='demo' controls autoplay width='50%' height='40%'&gt;
      &lt;source src="{{STATIC_URL}}sample1.mp4" type="video/mp4"&gt;&lt;/source&gt;
    &lt;/video&gt;
  {% endblock %}
  </code></pre>
  
  <p>Included this in  settings.py:</p>
  
  <pre><code> STATIC_URL = '/static/'
   STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
   MEDIA_URL = '/media/'
   MEDIA_ROOT = os.path.join(BASE_DIR, 'media')`
  </code></pre>
  
  <p>Views.py is:</p>
  
  <pre><code> from django.shortcuts import render, redirect
   from django.conf import settings
   from django.core.files.storage import FileSystemStorage
   from django.views.generic.base import TemplateView
   from uploads.core.models import Document
   from uploads.core.forms import DocumentForm
    def index(request):
       return render(request, "core/videoplay.html")`
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/iUY0r.png" rel="nofollow noreferrer">I am getting a play button and streaming line on my website</a></p>