Replace easy-thumbnails with imagekit

Closes #373
This commit is contained in:
Christopher C. Wells 2022-01-15 13:31:15 -08:00 committed by Christopher Charbonneau Wells
parent 8efce23ac3
commit 81f0fb94e7
7 changed files with 23 additions and 29 deletions

View File

@ -8,11 +8,11 @@ dj-database-url = "*"
django = "==3.*" django = "==3.*"
django-axes = "*" django-axes = "*"
django-filter = "*" django-filter = "*"
django-imagekit = "*"
django-import-export = "*" django-import-export = "*"
django-storages = "*" django-storages = "*"
django-widget-tweaks = "*" django-widget-tweaks = "*"
djangorestframework = "*" djangorestframework = "*"
easy-thumbnails = "*"
faker = "*" faker = "*"
gunicorn = "*" gunicorn = "*"
plotly = "*" plotly = "*"

View File

@ -40,7 +40,7 @@ INSTALLED_APPS = [
'rest_framework', 'rest_framework',
'rest_framework.authtoken', 'rest_framework.authtoken',
'widget_tweaks', 'widget_tweaks',
'easy_thumbnails', 'imagekit',
'storages', 'storages',
'import_export', 'import_export',
@ -231,7 +231,6 @@ AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY') or None
if AWS_STORAGE_BUCKET_NAME: if AWS_STORAGE_BUCKET_NAME:
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
THUMBNAIL_DEFAULT_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
# Security # Security

View File

@ -1,5 +1,5 @@
{% extends 'babybuddy/page.html' %} {% extends 'babybuddy/page.html' %}
{% load i18n static thumbnail duration %} {% load duration i18n imagekit static %}
{% block title %}{{ object }}{% endblock %} {% block title %}{{ object }}{% endblock %}
@ -13,7 +13,7 @@
<div class="row"> <div class="row">
<div class="col-lg-4 col-md-6 pb-3 text-center"> <div class="col-lg-4 col-md-6 pb-3 text-center">
{% if object.picture %} {% if object.picture %}
{% thumbnail object.picture 150x150 upscale crop as thumb %} {% thumbnail '150x150' object.picture as thumb %}
<img src="{{ thumb.url }}" class="child-photo img-fluid rounded-circle" /> <img src="{{ thumb.url }}" class="child-photo img-fluid rounded-circle" />
{% else %} {% else %}
<img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" class="child-photo img-fluid rounded-circle" /> <img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" class="child-photo img-fluid rounded-circle" />

View File

@ -1,5 +1,5 @@
{% extends 'babybuddy/page.html' %} {% extends 'babybuddy/page.html' %}
{% load i18n static thumbnail widget_tweaks %} {% load i18n imagekit static widget_tweaks %}
{% block title %}{% trans "Children" %}{% endblock %} {% block title %}{% trans "Children" %}{% endblock %}
@ -33,7 +33,7 @@
<tr> <tr>
<td class="picture-column"> <td class="picture-column">
{% if child.picture %} {% if child.picture %}
{% thumbnail child.picture 40x40 upscale crop as thumb %} {% thumbnail '40x40' child.picture as thumb %}
<img src="{{ thumb.url }}" class="img-fluid rounded-circle" /> <img src="{{ thumb.url }}" class="img-fluid rounded-circle" />
{% else %} {% else %}
<img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" width="40" height="40" class="img-fluid rounded-circle" /> <img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" width="40" height="40" class="img-fluid rounded-circle" />

View File

@ -1,5 +1,5 @@
{% extends 'babybuddy/page.html' %} {% extends 'babybuddy/page.html' %}
{% load cards i18n static thumbnail %} {% load cards i18n static %}
{% block title %}{% trans "Timeline" %}{% endblock %} {% block title %}{% trans "Timeline" %}{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends 'babybuddy/page.html' %} {% extends 'babybuddy/page.html' %}
{% load cards i18n static thumbnail %} {% load cards i18n imagekit static %}
{% block title %}{% trans "Dashboard" %}{% endblock %} {% block title %}{% trans "Dashboard" %}{% endblock %}
@ -19,7 +19,7 @@
<div class="card"> <div class="card">
<a class="text-center" href="{% url 'core:child' object.slug %}"> <a class="text-center" href="{% url 'core:child' object.slug %}">
{% if object.picture %} {% if object.picture %}
{% thumbnail object.picture 300x300 upscale crop as thumb %} {% thumbnail '300x300' object.picture as thumb %}
<img src="{{ thumb.url }}" class="child-photo img-fluid" /> <img src="{{ thumb.url }}" class="child-photo img-fluid" />
{% else %} {% else %}
<img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" class="child-photo img-fluid" /> <img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" class="child-photo img-fluid" />

View File

@ -7,49 +7,44 @@
-i https://pypi.python.org/simple -i https://pypi.python.org/simple
asgiref==3.4.1; python_version >= '3.6' asgiref==3.4.1; python_version >= '3.6'
boto3==1.20.24 boto3==1.20.37
botocore==1.23.24; python_version >= '3.6' botocore==1.23.37; python_version >= '3.6'
cssselect2==0.4.1; 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' 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' diff-match-patch==20200713; python_version >= '2.7'
dj-database-url==0.5.0 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-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-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-storages==1.12.3
django-widget-tweaks==1.4.9 django-widget-tweaks==1.4.12
django==3.2.10 django==3.2.11
djangorestframework==3.13.1 djangorestframework==3.13.1
easy-thumbnails==2.8
et-xmlfile==1.1.0; python_version >= '3.6' et-xmlfile==1.1.0; python_version >= '3.6'
faker==10.0.0 faker==11.3.0
gunicorn==20.1.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' 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 markuppy==1.14
odfpy==1.4.1 odfpy==1.4.1
openpyxl==3.0.9 openpyxl==3.0.9
pillow==8.4.0; python_version >= '3.6' pilkit==2.0
plotly==5.4.0 plotly==5.5.0
psycopg2-binary==2.9.2 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-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 python-dotenv==0.19.2
pytz==2021.3 pytz==2021.3
pyyaml==6.0 pyyaml==6.0
reportlab==3.6.3; python_version >= '3.6' and python_version < '4'
s3transfer==0.5.0; python_version >= '3.6' 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' 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' 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' tablib[html,ods,xls,xlsx,yaml]==3.1.0; python_version >= '3.6'
tenacity==8.0.1; python_version >= '3.6' tenacity==8.0.1; python_version >= '3.6'
text-unidecode==1.3 text-unidecode==1.3
tinycss2==1.1.1; python_version >= '3.6'
uritemplate==4.1.1 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' 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'
webencodings==0.5.1
whitenoise==5.3.0 whitenoise==5.3.0
xlrd==2.0.1 xlrd==2.0.1
xlwt==1.3.0 xlwt==1.3.0