Skip to content

Commit

Permalink
feat: support django 4.2 new STORAGES format
Browse files Browse the repository at this point in the history
Fix #716
  • Loading branch information
bellini666 committed Apr 3, 2023
1 parent b5f4d95 commit 71f3f44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sorl/thumbnail/conf/defaults.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

# When True ThumbnailNode.render can raise errors
THUMBNAIL_DEBUG = False
Expand Down Expand Up @@ -31,7 +32,10 @@
THUMBNAIL_VIPSHEADER = 'vipsheader'

# Storage for the generated thumbnails
THUMBNAIL_STORAGE = settings.DEFAULT_FILE_STORAGE
try:
THUMBNAIL_STORAGE = settings.STORAGES["default"]["BACKEND"]
except (AttributeError, KeyError, ImproperlyConfigured):
THUMBNAIL_STORAGE = settings.DEFAULT_FILE_STORAGE

# Redis settings
THUMBNAIL_REDIS_DB = 0
Expand Down

0 comments on commit 71f3f44

Please sign in to comment.