diff --git a/coderedcms/admin_urls.py b/coderedcms/admin_urls.py index 8a596150..4b6bbb42 100644 --- a/coderedcms/admin_urls.py +++ b/coderedcms/admin_urls.py @@ -1,4 +1,4 @@ -from django.urls import include, path, re_path +from django.urls import include, path from wagtail.admin import urls as wagtailadmin_urls from coderedcms.views import import_index, import_pages_from_csv_file @@ -8,5 +8,5 @@ import_index, name="import_index"), path('codered/import-export/import_from_csv/', import_pages_from_csv_file, name="import_from_csv"), - re_path(r'', include(wagtailadmin_urls)), + path('', include(wagtailadmin_urls)), ] diff --git a/coderedcms/importexport.py b/coderedcms/importexport.py index 9a6c50cd..48ea6228 100644 --- a/coderedcms/importexport.py +++ b/coderedcms/importexport.py @@ -14,7 +14,7 @@ from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.db import models, transaction -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from modelcluster.models import get_all_child_relations from wagtail.admin.widgets import AdminPageChooser from wagtail.core.models import Page diff --git a/coderedcms/project_template/basic/project_name/urls.py b/coderedcms/project_template/basic/project_name/urls.py index c59759a4..55c3fff1 100644 --- a/coderedcms/project_template/basic/project_name/urls.py +++ b/coderedcms/project_template/basic/project_name/urls.py @@ -1,5 +1,5 @@ from django.conf import settings -from django.urls import include, path, re_path +from django.urls import include, path from django.contrib import admin from wagtail.documents import urls as wagtaildocs_urls from coderedcms import admin_urls as coderedadmin_urls @@ -20,11 +20,11 @@ # For anything not caught by a more specific rule above, hand over to # the page serving mechanism. This should be the last pattern in # the list: - re_path(r'', include(codered_urls)), + path('', include(codered_urls)), # Alternatively, if you want CMS pages to be served from a subpath # of your site, rather than the site root: - # re_path(r"^pages/", include(codered_urls)), + # path("pages/", include(codered_urls)), ] diff --git a/coderedcms/project_template/sass/project_name/urls.py b/coderedcms/project_template/sass/project_name/urls.py index 1e2276c5..55c3fff1 100644 --- a/coderedcms/project_template/sass/project_name/urls.py +++ b/coderedcms/project_template/sass/project_name/urls.py @@ -1,5 +1,5 @@ from django.conf import settings -from django.urls import include, path, re_path +from django.urls import include, path from django.contrib import admin from wagtail.documents import urls as wagtaildocs_urls from coderedcms import admin_urls as coderedadmin_urls @@ -20,11 +20,11 @@ # For anything not caught by a more specific rule above, hand over to # the page serving mechanism. This should be the last pattern in # the list: - re_path(r'', include(codered_urls)), + path('', include(codered_urls)), # Alternatively, if you want CMS pages to be served from a subpath # of your site, rather than the site root: - # re_path(r'^pages/', include(codered_urls)), + # path("pages/", include(codered_urls)), ] diff --git a/coderedcms/search_urls.py b/coderedcms/search_urls.py index 0d45d953..a45bc3c9 100644 --- a/coderedcms/search_urls.py +++ b/coderedcms/search_urls.py @@ -1,6 +1,6 @@ -from django.urls import re_path +from django.urls import path from coderedcms.views import search urlpatterns = [ - re_path(r'', search, name='codered_search'), + path('', search, name='codered_search'), ] diff --git a/coderedcms/urls.py b/coderedcms/urls.py index ccc226d7..ae26d3a1 100644 --- a/coderedcms/urls.py +++ b/coderedcms/urls.py @@ -15,9 +15,9 @@ urlpatterns = [ # CodeRed custom URLs - re_path(r'^favicon\.ico$', favicon, name='codered_favicon'), - re_path(r'^robots\.txt$', robots, name='codered_robots'), - re_path(r'^sitemap\.xml$', sitemap, name='codered_sitemap'), + path(r'favicon.ico', favicon, name='codered_favicon'), + path(r'robots.txt', robots, name='codered_robots'), + path(r'sitemap.xml', sitemap, name='codered_sitemap'), re_path(r'^{0}(?P.*)$'.format( crx_settings.CRX_PROTECTED_MEDIA_URL.lstrip('/')), serve_protected_file, @@ -34,5 +34,5 @@ path('ajax/calendar/events/', event_get_calendar_events, name='event_get_calendar_events'), # Wagtail - re_path(r'', include(wagtailcore_urls)), + path('', include(wagtailcore_urls)), ] diff --git a/coderedcms/views.py b/coderedcms/views.py index 2f8c4a56..cce7b367 100644 --- a/coderedcms/views.py +++ b/coderedcms/views.py @@ -8,7 +8,7 @@ from django.core.paginator import Paginator, InvalidPage, EmptyPage, PageNotAnInteger from django.shortcuts import redirect, render from django.utils import timezone -from django.utils.translation import ungettext, gettext_lazy as _ +from django.utils.translation import ngettext, gettext_lazy as _ from icalendar import Calendar from wagtail.admin import messages from wagtail.search.backends import db, get_search_backend @@ -261,7 +261,7 @@ def import_pages_from_csv_file(request): "Import failed: %(reason)s") % {'reason': e} ) else: - messages.success(request, ungettext( + messages.success(request, ngettext( "%(count)s page imported.", "%(count)s pages imported.", page_count) % {'count': page_count} diff --git a/coderedcms/wagtail_flexible_forms/wagtail_hooks.py b/coderedcms/wagtail_flexible_forms/wagtail_hooks.py index 78953b41..647c0d81 100755 --- a/coderedcms/wagtail_flexible_forms/wagtail_hooks.py +++ b/coderedcms/wagtail_flexible_forms/wagtail_hooks.py @@ -1,8 +1,7 @@ -from django.conf.urls import url from django.contrib.admin import SimpleListFilter from django.contrib.admin.utils import quote from django.shortcuts import redirect -from django.urls import reverse +from django.urls import path, reverse from django.utils.translation import gettext_lazy as _ from wagtail.contrib.modeladmin.helpers import ( PermissionHelper, PagePermissionHelper, PageAdminURLHelper, AdminURLHelper, @@ -302,9 +301,11 @@ def set_status_view(self, request, instance_pk): def get_admin_urls_for_registration(self): urls = super().get_admin_urls_for_registration() urls += ( - url(self.url_helper.get_action_url_pattern('set_status'), + path( + self.url_helper.get_action_url_pattern('set_status'), self.set_status_view, - name=self.url_helper.get_action_url_name('set_status')), + name=self.url_helper.get_action_url_name('set_status') + ), ) return urls diff --git a/setup.py b/setup.py index 42fd6bb6..8455f451 100755 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ 'Programming Language :: Python :: 3 :: Only', 'Framework :: Django', 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.0', 'Framework :: Wagtail', 'Framework :: Wagtail :: 2', 'Topic :: Internet :: WWW/HTTP', @@ -45,7 +46,7 @@ 'beautifulsoup4>=4.8,<4.10', # should be the same as wagtail 'django-eventtools==1.0.*', 'django-bootstrap4==22.1', - 'Django>=3.2,<4.0', # should be the same as wagtail + 'Django>=3.2,<4.1', # should be the same as wagtail 'geocoder==1.38.*', 'icalendar==4.0.*', 'wagtail==2.16.*',