[Fixed]-Upload video to amazon s3 using django and python

1👍

You can use S3BotoStorage.

$ pip install django-storages boto
Add ‘storages’ to INSTALLED_APPS:

INSTALLED_APPS = (
      ...,
      'storages',
 )

adding another storage class:

class MediaStorage(S3BotoStorage):
    location = settings.MEDIAFILES_LOCATION

and in settings.py:

MEDIAFILES_LOCATION = 'media'
MEDIA_URL = "https://%s/%s/" % (AWS_S3_CUSTOM_DOMAIN, MEDIAFILES_LOCATION)
DEFAULT_FILE_STORAGE = 'custom_storages.MediaStorage'

Leave a comment