Can't connect Digital Ocean Spaces with Django, when I upload a file instead of saving it on DO it creates new folder locally
I'm trying to configure Django to upload media files to DigitalOcean Spaces when running in production. I've set up the following in my settings.py
:
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
AWS_ACCESS_KEY_ID = os.environ.get('DO_SPACES_ACCESS_KEY')
AWS_SECRET_ACCESS_KEY = os.environ.get('DO_SPACES_SECRET')
AWS_STORAGE_BUCKET_NAME = os.environ.get('DO_SPACES_SPACE_NAME')
AWS_S3_ENDPOINT_URL = os.environ.get('DO_SPACES_ENDPOINT')
AWS_S3_FILE_OVERWRITE = False
AWS_DEFAULT_ACL = None
AWS_LOCATION = 'media' # Folder inside your space for uploaded files
MEDIA_URL = 'https://andonov-restaurant.fra1.digitaloceanspaces.com/media/'