Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support django 4.2 new STORAGES format #728

Merged
merged 4 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
target: [pil, imagemagick, graphicsmagick, redis, wand, dbm]

include:
Expand Down
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
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[gh-actions:env]
DJANGO =
3.2: django32
4.0: django40
4.1: django41
4.2: django42
TARGET =
pil: pil
imagemagick: imagemagick
Expand All @@ -24,7 +26,7 @@ skipsdist = True
envlist =
py38-qa,
py37-django32-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}
py{38,39,310}-django{32,40,41}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}
py{38,39,310,311}-django{32,40,41,42}-{pil,imagemagick,graphicsmagick,redis,dynamodb,wand,pgmagick,dbm,vipsthumbnail}

[testenv]
deps =
Expand All @@ -39,6 +41,7 @@ deps =
django32: django>=3.2,<3.3
django40: django>=4.0,<4.1
django41: django>=4.1,<4.2
django42: django>=4.2,<4.3

setenv =
PYTHONPATH = {toxinidir}:{toxinidir}
Expand Down