diff --git a/django_hashedfilenamestorage/storage.py b/django_hashedfilenamestorage/storage.py index a2ec4ea..a8560d8 100644 --- a/django_hashedfilenamestorage/storage.py +++ b/django_hashedfilenamestorage/storage.py @@ -4,9 +4,11 @@ from django.core.files import File from django.core.files.storage import FileSystemStorage -from django.utils.encoding import force_text from django.core.exceptions import ImproperlyConfigured +encoding = importlib.import_module('django.utils.encoding') +globals().setdefault('force_text', getattr(encoding, 'force_str', 'force_text')) + def HashedFilenameMetaStorage(storage_class): class HashedFilenameStorage(storage_class):