Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit b4405ad

Browse files
committed
Changes to build with leading edge Wagtail/Python
1 parent 08415e8 commit b4405ad

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Docker configuration for backend development. Not created for production use.
22
# It does not include front-end .
33
# Main production build is done using Dockerfile in the root of the project
4-
FROM breneser/mssql-python-nodejs
4+
FROM python:3.10-bullseye
55

66
WORKDIR /code
77
ADD requirements.txt /code/
8-
RUN pip install --upgrade pip && pip install -r requirements.txt
8+
RUN python -V && pip install --upgrade pip && pip install -r requirements.txt
99
ADD . /code

config/settings/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1919
BASE_DIR = os.path.dirname(PROJECT_DIR)
2020

21+
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
2122

2223
# Quick-start development settings - unsuitable for production
2324
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
@@ -72,7 +73,6 @@
7273
'django.contrib.messages.middleware.MessageMiddleware',
7374
'django.middleware.clickjacking.XFrameOptionsMiddleware',
7475
'django.middleware.security.SecurityMiddleware',
75-
'wagtail.core.middleware.SiteMiddleware',
7676
'wagtail.contrib.redirects.middleware.RedirectMiddleware',
7777
]
7878

requirements.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
Django>=3.1,<3.2
2-
wagtail>=2.10,<2.11
1+
Django~=4.0
2+
wagtail~=2.16
33
psycopg2>=2.8,<2.9
44
python-crontab>=2.5,<2.6
55
django-cors-headers>=3.5,<3.6
6-
django-storages>=1.10,<1.11
7-
azure>=4,<5
6+
django-storages[azure]~=1.12
7+
azure-storage-common~=2.1
8+
azure-storage-file~=2.1
9+
azure-storage-blob~=12.9
10+
azure-core~=1.23
811
coverage>=5.2,<5.3
912
gunicorn>=20.0,<20.1
1013
flake8>=3.8,<3.9
11-
django-debug-toolbar>=2.2,<2.3
14+
django-debug-toolbar~=3.2
1215
factory-boy>=3.0,<3.1
13-
django_extensions>=3.0,<3.1
16+
django_extensions~=3.1
1417
safety

urls.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import, unicode_literals
22

33
from django.conf import settings
4-
from django.conf.urls import include, url
4+
from django.conf.urls import include
55
from django.urls import include, path, re_path
66
from django.contrib import admin
77
from django.http import HttpResponse
@@ -17,11 +17,11 @@
1717

1818

1919
urlpatterns = [
20-
url(r'^django-admin/', admin.site.urls),
21-
url(r'^admin/', include(wagtailadmin_urls)),
22-
url(r'^documents/', include(wagtaildocs_urls)),
23-
url(r'^api/v2/', api_router.urls),
24-
url(r'', include(wagtail_urls)),
20+
re_path(r'^django-admin/', admin.site.urls),
21+
re_path(r'^admin/', include(wagtailadmin_urls)),
22+
re_path(r'^documents/', include(wagtaildocs_urls)),
23+
re_path(r'^api/v2/', api_router.urls),
24+
re_path(r'', include(wagtail_urls)),
2525
]
2626

2727
if settings.DEBUG:
@@ -35,5 +35,5 @@
3535

3636
# Django debug toolbar
3737
urlpatterns = [
38-
url(r'^__debug__/', include(debug_toolbar.urls)),
38+
re_path(r'^__debug__/', include(debug_toolbar.urls)),
3939
] + urlpatterns

wagtailreacttaxonomy/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from azure.common import AzureMissingResourceHttpError
77
from azure.storage.file.models import File as AzureFile, Directory as AzureDirectory
88

9-
from azure.storage.blob import BlockBlobService
9+
from azure.storage.blob import BlobServiceClient
1010

1111
from django.db import models
1212
from django.db.models.signals import pre_save
@@ -30,7 +30,7 @@ def update_taxonomy_terms_on_blobstore(sender, instance, **kwargs):
3030
content['terms'] = terms_with_vocab
3131

3232
blobPath = f'taxonomy/{instance.taxonomy_id}.json'
33-
blob_service = BlockBlobService(account_name=settings.AZURE_ACCOUNT_NAME, account_key=settings.AZURE_ACCOUNT_KEY)
33+
blob_service = BlobServiceClient(account_name=settings.AZURE_ACCOUNT_NAME, account_key=settings.AZURE_ACCOUNT_KEY)
3434
blob_service.create_blob_from_text(settings.AZURE_CONTAINER, blobPath, to_json(content))
3535
logger.info('Successfully wrote taxonomy json to BlobStore %s', blobPath)
3636

0 commit comments

Comments
 (0)