From 81f0fb94e7db6175ce0664af5c4d8039b6e62966 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Sat, 15 Jan 2022 13:31:15 -0800 Subject: [PATCH] Replace easy-thumbnails with imagekit Closes #373 --- Pipfile | 2 +- babybuddy/settings/base.py | 3 +- core/templates/core/child_detail.html | 4 +-- core/templates/core/child_list.html | 4 +-- core/templates/timeline/timeline.html | 2 +- dashboard/templates/dashboard/dashboard.html | 4 +-- requirements.txt | 33 +++++++++----------- 7 files changed, 23 insertions(+), 29 deletions(-) diff --git a/Pipfile b/Pipfile index ae1bb702..a391162f 100644 --- a/Pipfile +++ b/Pipfile @@ -8,11 +8,11 @@ dj-database-url = "*" django = "==3.*" django-axes = "*" django-filter = "*" +django-imagekit = "*" django-import-export = "*" django-storages = "*" django-widget-tweaks = "*" djangorestframework = "*" -easy-thumbnails = "*" faker = "*" gunicorn = "*" plotly = "*" diff --git a/babybuddy/settings/base.py b/babybuddy/settings/base.py index 7f596d09..43b509cc 100644 --- a/babybuddy/settings/base.py +++ b/babybuddy/settings/base.py @@ -40,7 +40,7 @@ INSTALLED_APPS = [ 'rest_framework', 'rest_framework.authtoken', 'widget_tweaks', - 'easy_thumbnails', + 'imagekit', 'storages', 'import_export', @@ -231,7 +231,6 @@ AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY') or None if AWS_STORAGE_BUCKET_NAME: DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' - THUMBNAIL_DEFAULT_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' # Security diff --git a/core/templates/core/child_detail.html b/core/templates/core/child_detail.html index 75746a18..4caf2885 100644 --- a/core/templates/core/child_detail.html +++ b/core/templates/core/child_detail.html @@ -1,5 +1,5 @@ {% extends 'babybuddy/page.html' %} -{% load i18n static thumbnail duration %} +{% load duration i18n imagekit static %} {% block title %}{{ object }}{% endblock %} @@ -13,7 +13,7 @@
{% if object.picture %} - {% thumbnail object.picture 150x150 upscale crop as thumb %} + {% thumbnail '150x150' object.picture as thumb %} {% else %} diff --git a/core/templates/core/child_list.html b/core/templates/core/child_list.html index 094455c1..9d55f3d0 100644 --- a/core/templates/core/child_list.html +++ b/core/templates/core/child_list.html @@ -1,5 +1,5 @@ {% extends 'babybuddy/page.html' %} -{% load i18n static thumbnail widget_tweaks %} +{% load i18n imagekit static widget_tweaks %} {% block title %}{% trans "Children" %}{% endblock %} @@ -33,7 +33,7 @@ {% if child.picture %} - {% thumbnail child.picture 40x40 upscale crop as thumb %} + {% thumbnail '40x40' child.picture as thumb %} {% else %} diff --git a/core/templates/timeline/timeline.html b/core/templates/timeline/timeline.html index 77c315eb..005b23e0 100644 --- a/core/templates/timeline/timeline.html +++ b/core/templates/timeline/timeline.html @@ -1,5 +1,5 @@ {% extends 'babybuddy/page.html' %} -{% load cards i18n static thumbnail %} +{% load cards i18n static %} {% block title %}{% trans "Timeline" %}{% endblock %} diff --git a/dashboard/templates/dashboard/dashboard.html b/dashboard/templates/dashboard/dashboard.html index 2f14528a..b981d51b 100644 --- a/dashboard/templates/dashboard/dashboard.html +++ b/dashboard/templates/dashboard/dashboard.html @@ -1,5 +1,5 @@ {% extends 'babybuddy/page.html' %} -{% load cards i18n static thumbnail %} +{% load cards i18n imagekit static %} {% block title %}{% trans "Dashboard" %}{% endblock %} @@ -19,7 +19,7 @@
{% if object.picture %} - {% thumbnail object.picture 300x300 upscale crop as thumb %} + {% thumbnail '300x300' object.picture as thumb %} {% else %} diff --git a/requirements.txt b/requirements.txt index 8e285302..f0cd2e26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,49 +7,44 @@ -i https://pypi.python.org/simple asgiref==3.4.1; python_version >= '3.6' -boto3==1.20.24 -botocore==1.23.24; python_version >= '3.6' -cssselect2==0.4.1; python_version >= '3.6' +boto3==1.20.37 +botocore==1.23.37; python_version >= '3.6' defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' diff-match-patch==20200713; python_version >= '2.7' dj-database-url==0.5.0 -django-axes==5.28.0 +django-appconf==1.0.5; python_version >= '3.1' +django-axes==5.31.0 django-filter==21.1 -django-import-export==2.7.0 +django-imagekit==4.1.0 +django-import-export==2.7.1 django-ipware==4.0.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' django-storages==1.12.3 -django-widget-tweaks==1.4.9 -django==3.2.10 +django-widget-tweaks==1.4.12 +django==3.2.11 djangorestframework==3.13.1 -easy-thumbnails==2.8 et-xmlfile==1.1.0; python_version >= '3.6' -faker==10.0.0 +faker==11.3.0 gunicorn==20.1.0 jmespath==0.10.0; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3' -lxml==4.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' markuppy==1.14 odfpy==1.4.1 openpyxl==3.0.9 -pillow==8.4.0; python_version >= '3.6' -plotly==5.4.0 -psycopg2-binary==2.9.2 +pilkit==2.0 +plotly==5.5.0 +psycopg2-binary==2.9.3 python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' python-dotenv==0.19.2 pytz==2021.3 pyyaml==6.0 -reportlab==3.6.3; python_version >= '3.6' and python_version < '4' s3transfer==0.5.0; python_version >= '3.6' -setuptools==59.7.0; python_version >= '3.7' +setuptools==60.5.0; python_version >= '3.7' six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' sqlparse==0.4.2; python_version >= '3.5' -svglib==1.1.0; python_version >= '3' tablib[html,ods,xls,xlsx,yaml]==3.1.0; python_version >= '3.6' tenacity==8.0.1; python_version >= '3.6' text-unidecode==1.3 -tinycss2==1.1.1; python_version >= '3.6' uritemplate==4.1.1 -urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4' -webencodings==0.5.1 +urllib3==1.26.8; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4' whitenoise==5.3.0 xlrd==2.0.1 xlwt==1.3.0