Created
May 6, 2018 15:20
-
-
Save jerinisready/0b3cdd09dbc972711a4f3fabcd5cd42b to your computer and use it in GitHub Desktop.
I got " NotImplementedError: This backend doesn't support absolute paths. " when integrated a project's Media storage with `S3 Bucket` with `django-storage` and `boto3`. This was because of the conflict, that was in the s3boto storage class the path method was not implemented. Here is how I solved It. I created a new Class Inderrited From Boto3S…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils.encoding import filepath_to_uri | |
from storages.backends.s3boto3 import S3Boto3Storage | |
class CustomStorage(S3Boto3Storage): | |
def path(self, name): | |
return filepath_to_uri(name) | |
""" | |
# in settings.py, I Updated | |
DEFAULT_FILE_STORAGE = '<project_name>.s3boto3_overrided_storage.CustomStorage' | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment