Skip to content

Commit 7e13e4a

Browse files
authored
Merge pull request #457 from bruecksen/456-update-wagtail
#456 update wagtail and django to latest LTS versions
2 parents 400f8d5 + 952e22e commit 7e13e4a

File tree

8 files changed

+42
-60
lines changed

8 files changed

+42
-60
lines changed

bakeup/core/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.contrib.admin.utils import NestedObjects
2-
from django.utils.encoding import force_text
2+
from django.utils.encoding import force_str
33
from django.utils.text import capfirst
44

55

@@ -10,7 +10,7 @@ def get_deleted_objects(objs):
1010
#
1111
def format_callback(obj):
1212
opts = obj._meta
13-
no_edit_link = "%s: %s" % (capfirst(opts.verbose_name), force_text(obj))
13+
no_edit_link = "%s: %s" % (capfirst(opts.verbose_name), force_str(obj))
1414
return no_edit_link
1515

1616
#

bakeup/pages/wagtail_hooks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.urls import reverse
2-
from django.utils.translation import ugettext_lazy as _
2+
from django.utils.translation import gettext_lazy as _
33
from wagtail import hooks
44
from wagtailmenus.models import MainMenu
55

bakeup/users/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = "bakeup.users.apps.UsersConfig"

bakeup/users/admin.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ def change_view(self, request, object_id, form_url="", extra_context=None):
3535
self.request = request
3636
return super().change_view(request, object_id, form_url, extra_context)
3737

38+
@admin.display(description="Token URL")
3839
def token_url(self, obj):
3940
return obj.token_url(self.request)
4041

41-
token_url.short_description = "Token URL"
42-
token_url.allow_tags = True
43-
42+
@admin.display(description="QR Code")
4443
def qr_code_svg(self, obj):
4544
return obj.qr_code_svg(self.request)
46-
47-
qr_code_svg.short_description = "QR Code"
48-
qr_code_svg.allow_tags = True

config/settings/base.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
# https://docs.djangoproject.com/en/dev/ref/settings/#use-i18n
3232
USE_I18N = True
3333
# https://docs.djangoproject.com/en/dev/ref/settings/#use-l10n
34-
USE_L10N = True
3534
# https://docs.djangoproject.com/en/dev/ref/settings/#use-tz
3635
USE_TZ = True
3736
# https://docs.djangoproject.com/en/dev/ref/settings/#locale-paths
@@ -94,7 +93,6 @@
9493
"sorl.thumbnail",
9594
"django.contrib.auth",
9695
"django.contrib.sessions",
97-
"wagtail.contrib.modeladmin",
9896
"wagtail.contrib.forms",
9997
"wagtail.contrib.redirects",
10098
"wagtail.contrib.settings",
@@ -189,6 +187,7 @@
189187
"django.middleware.clickjacking.XFrameOptionsMiddleware",
190188
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
191189
"bakeup.core.middleware.PersistentFiltersMiddleware",
190+
"allauth.account.middleware.AccountMiddleware",
192191
]
193192

194193
# STATIC

config/settings/production.py

+9-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import sentry_sdk
44
from sentry_sdk.integrations.django import DjangoIntegration
55
from sentry_sdk.integrations.logging import LoggingIntegration
6-
from sentry_sdk.integrations.redis import RedisIntegration
76

87
from .base import * # noqa
98
from .base import env
@@ -22,21 +21,6 @@
2221
DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60) # noqa F405
2322
DATABASES["default"]["ENGINE"] = "django_tenants.postgresql_backend" # noqa F405
2423

25-
# CACHES
26-
# ------------------------------------------------------------------------------
27-
# CACHES = {
28-
# "default": {
29-
# "BACKEND": "django_redis.cache.RedisCache",
30-
# "LOCATION": env("REDIS_URL"),
31-
# "OPTIONS": {
32-
# "CLIENT_CLASS": "django_redis.client.DefaultClient",
33-
# # Mimicing memcache behavior.
34-
# # https://github.com/jazzband/django-redis#memcached-exceptions-behavior
35-
# "IGNORE_EXCEPTIONS": True,
36-
# },
37-
# }
38-
# }
39-
4024
CACHES = {
4125
"default": {
4226
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
@@ -72,7 +56,14 @@
7256

7357
# STATIC
7458
# ------------------------
75-
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
59+
STORAGES = {
60+
"default": {
61+
"BACKEND": "django.core.files.storage.FileSystemStorage",
62+
},
63+
"staticfiles": {
64+
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
65+
},
66+
}
7667
# MEDIA
7768
# ------------------------------------------------------------------------------
7869

@@ -163,7 +154,7 @@
163154
level=SENTRY_LOG_LEVEL, # Capture info and above as breadcrumbs
164155
event_level=logging.ERROR, # Send errors as events
165156
)
166-
integrations = [sentry_logging, DjangoIntegration(), RedisIntegration()]
157+
integrations = [sentry_logging, DjangoIntegration()]
167158
sentry_sdk.init(
168159
send_default_pii=True,
169160
dsn=SENTRY_DSN,

config/urls.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from django.conf.urls.static import static
33
from django.contrib import admin
44
from django.contrib.auth import views as auth_views
5-
from django.urls import include, path, re_path
5+
from django.urls import include, path
66
from django.views import defaults as default_views
77
from django.views.generic import RedirectView
88
from wagtail import urls as wagtail_urls
@@ -26,7 +26,7 @@
2626
path("users/", include("bakeup.users.urls", namespace="users")),
2727
path("workshop/", include("bakeup.workshop.urls", namespace="workshop")),
2828
path("shop/", include("bakeup.shop.urls", namespace="shop")),
29-
re_path(r"shop/", include(wagtail_urls)),
29+
path("shop/", include(wagtail_urls)),
3030
# path("login/", LoginView.as_view(), name='login'),
3131
path("logout/", auth_views.LogoutView.as_view(), name="logout"),
3232
path(

requirements/base.txt

+25-28
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
pytz==2021.3 # https://github.com/stub42/pytz
1+
pytz==2024.1 # https://github.com/stub42/pytz
22
python-slugify==6.1.1 # https://github.com/un33k/python-slugify
3-
Pillow==9.0.1 # https://github.com/python-pillow/Pillow
4-
argon2-cffi==21.3.0 # https://github.com/hynek/argon2_cffi
5-
whitenoise==6.0.0 # https://github.com/evansd/whitenoise
6-
redis==4.1.4 # https://github.com/redis/redis-py
7-
hiredis==2.0.0 # https://github.com/redis/hiredis-py
3+
Pillow==10.2.0 # https://github.com/python-pillow/Pillow
4+
argon2-cffi==23.1.0 # https://github.com/hynek/argon2_cffi
5+
whitenoise==6.6.0 # https://github.com/evansd/whitenoise
86

97
# Django
108
# ------------------------------------------------------------------------------
11-
django==3.2.12 # pyup: < 4.0 # https://www.djangoproject.com/
12-
django-environ==0.8.1 # https://github.com/joke2k/django-environ
13-
django-model-utils==4.2.0 # https://github.com/jazzband/django-model-utils
14-
django-crispy-forms==1.14.0 # https://github.com/django-crispy-forms/django-crispy-forms
15-
crispy-bootstrap5==0.6 # https://github.com/django-crispy-forms/crispy-bootstrap5
16-
django-redis==5.2.0 # https://github.com/jazzband/django-redis
17-
django-recurrence==1.11.1
18-
django-tables2==2.4.1
19-
django-treebeard==4.5.1
20-
sorl-thumbnail==12.8.0
21-
django_bootstrap5==21.3
22-
django_filter==21.1
9+
django==4.2.11 # pyup: < 5.0 # https://www.djangoproject.com/
10+
django-environ==0.11.2 # https://github.com/joke2k/django-environ
11+
django-model-utils==4.4.0 # https://github.com/jazzband/django-model-utils
12+
django-allauth==0.61.1 # https://github.com/pennersr/django-allauth
13+
django-crispy-forms==2.1 # https://github.com/django-crispy-forms/django-crispy-forms
14+
crispy-bootstrap5==2024.2 # https://github.com/django-crispy-forms/crispy-bootstrap5
15+
16+
django-tables2==2.7.0
17+
django-treebeard==4.7.1
18+
sorl-thumbnail==12.10.0
19+
django_bootstrap5==23.4
20+
django_filter==23.5
2321
django-tenants==3.6.1
24-
qrcode==7.3.1
25-
django-taggit==3.0.0
26-
django-allauth==0.49.0
27-
django-persistent-filters==0.21
28-
django-htmx==1.14.0
29-
wagtail==4.2.*
30-
tablib==3.4.0
31-
wagtailmenus==3.1.7
22+
qrcode==7.4.2
23+
django-taggit==4.0.0
24+
django-persistent-filters==1.0
25+
django-htmx==1.17.3
26+
wagtail==5.2.*
27+
tablib==3.5.0
28+
wagtailmenus==4.0
3229
babel==2.9.1 # newer version fails because of langauge variants https://github.com/python-babel/babel/issues/454
33-
django-money==3.2.0
34-
django-autocomplete-light==3.9.7
30+
django-money==3.4.1
31+
django-autocomplete-light==3.11.0

0 commit comments

Comments
 (0)