title: How to point Django .html to S3 media file? AccessDenied
body: <p>I can upload files to the S3 bucket from my django app using the models admin view. I can also view the video within my django app admin view.
  But I am not able to view the video via the django <strong>.html</strong> file. </p>
  
  <p>Here is my <strong>models.py</strong> file</p>
  
  <pre><code>from project_4.storage_backends import MediaStorage
  
  class video(models.Model):
      videofile = models.FileField(storage=MediaStorage(), null=True, verbose_name="", unique=True)
  </code></pre>
  
  <p>I created a <strong>storage_backends.py</strong> under my app project folder</p>
  
  <pre><code>from django.conf import settings
  from storages.backends.s3boto3 import S3Boto3Storage
  
  
  class MediaStorage(S3Boto3Storage):
      location = settings.AWS_MEDIA_LOCATION
      default_acl = 'private'  # To turn access control list into private use only. Will use it in models.py
      file_overwrite = False  # Not to replace files even they have same name
      custom_domain = False
  </code></pre>
  
  <p>In my <strong>settings.py</strong> I added the following</p>
  
  <pre><code>import boto3
  from botocore.client import Config
  
  MEDIA_URL = '/media/'
  MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
  
  AWS_ACCESS_KEY_ID = 'x'
  AWS_SECRET_ACCESS_KEY = 'x'
  AWS_STORAGE_BUCKET_NAME = 'django-draft-project-1'
  AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
  AWS_S3_FILE_OVERWRITE = False
  AWS_DEFAULT_ACL = None
  AWS_S3_REGION_NAME = "eu-central-1"
  AWS_S3_SIGNATURE_VERSION = "s3v4"
  
  # AWS S3 Private Media Upload
  AWS_MEDIA_LOCATION = 'media'
  PRIVATE_FILE_STORAGE = 'project_4.storage_backends.MediaStorage'
  AWS_S3_OBJECT_PARAMETERS = {
      'Expires': 'Thu, 31 Dec 2099 20:00:00 GMT',
      'CacheControl': 'max-age=94608000',
  }
  </code></pre>
  
  <p>At this point, I am able to upload and view my video through the admin console. Now I would like the video to be viewable within my html.</p>
  
  <pre><code>&lt;video controls&gt;
  &lt;source src={{ S3_URL }}{{ detailedview.video_name }}&gt;
  &lt;/video&gt;
  </code></pre>
  
  <p>The <code>{{ S3_URL }}{{ detailedview.video_name }}</code> yields the root URL I see in the admin page which is <code>https://django-draft-project-1.s3.amazonaws.com/media/SampleVideo_1280x720_10mb.mp4</code> however pasting this url directing causes <code>&lt;Code&gt;AccessDenied&lt;/Code&gt;</code></p>
  
  <p>The actual admin url on top when I play the video is </p>
  
  <pre><code>https://django-draft-project-1.s3.amazonaws.com/media/SampleVideo_1280x720_10mb.mp4?X-Amz-Algorithm=wewe-HMAC-wewe&amp;X-Amz-Credential=wewewe%2F20190401%wwewwe-central-1%2Fs3%wewe&amp;X-Amz-Date=20190401T053817Z&amp;X-Amz-Expires=3600&amp;X-Amz-SignedHeaders=host&amp;ewew-Signature=123456qwertasdfzxcvasdfwert
  </code></pre>
  
  <p>Moreover, my object url on the s3 console is Object URL</p>
  
  <pre><code>https://s3.eu-central-1.amazonaws.com/django-draft-project-1/media/SampleVideo_1280x720_5mb.mp4
  </code></pre>
  
  <p>But also using it directly yields <code>&lt;Code&gt;AccessDenied&lt;/Code&gt;</code></p>
  
  <p>How can I fix the access denied within my .html so I can play the media file back to the user?</p>