*: Use django.urls.re_path() instead of its alias url()

- In Django 2.2 django.conf.urls.url() is an alias to django.urls.re_path().

- In Django 4.0, url() function will be removed. On Django 3.2, it throws a
warning that this function will be removed in future.

Tests:

- Run unit tests with Django 3.2 and Django 2.2.

- With Django 3.2 there are no warnings when running unit tests and when running
FreedomBox Service.

- Visit a few affected apps with both Django versions.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2021-09-20 16:50:47 -04:00
1 parent a3e21adc8b
commit cd2b2f5f2c
65 files changed
+359 -338

No files matched your search

+18 -18
View File
@@ -3,26 +3,26 @@
URLs for the wireguard module.
"""
from django.conf.urls import url
from django.urls import re_path
from plinth.modules.wireguard import views
urlpatterns = [
url(r'^apps/wireguard/$', views.WireguardView.as_view(), name='index'),
url(r'^apps/wireguard/client/add/$', views.AddClientView.as_view(),
name='add-client'),
url(r'^apps/wireguard/client/(?P<public_key>[^/]+)/show/$',
views.ShowClientView.as_view(), name='show-client'),
url(r'^apps/wireguard/client/(?P<public_key>[^/]+)/edit/$',
views.EditClientView.as_view(), name='edit-client'),
url(r'^apps/wireguard/client/(?P<public_key>[^/]+)/delete/$',
views.DeleteClientView.as_view(), name='delete-client'),
url(r'^apps/wireguard/server/add/$', views.AddServerView.as_view(),
name='add-server'),
url(r'^apps/wireguard/server/(?P<interface>wg[0-9]+)/show/$',
views.ShowServerView.as_view(), name='show-server'),
url(r'^apps/wireguard/server/(?P<interface>wg[0-9]+)/edit/$',
views.EditServerView.as_view(), name='edit-server'),
url(r'^apps/wireguard/server/(?P<interface>wg[0-9]+)/delete/$',
views.DeleteServerView.as_view(), name='delete-server'),
re_path(r'^apps/wireguard/$', views.WireguardView.as_view(), name='index'),
re_path(r'^apps/wireguard/client/add/$', views.AddClientView.as_view(),
name='add-client'),
re_path(r'^apps/wireguard/client/(?P<public_key>[^/]+)/show/$',
views.ShowClientView.as_view(), name='show-client'),
re_path(r'^apps/wireguard/client/(?P<public_key>[^/]+)/edit/$',
views.EditClientView.as_view(), name='edit-client'),
re_path(r'^apps/wireguard/client/(?P<public_key>[^/]+)/delete/$',
views.DeleteClientView.as_view(), name='delete-client'),
re_path(r'^apps/wireguard/server/add/$', views.AddServerView.as_view(),
name='add-server'),
re_path(r'^apps/wireguard/server/(?P<interface>wg[0-9]+)/show/$',
views.ShowServerView.as_view(), name='show-server'),
re_path(r'^apps/wireguard/server/(?P<interface>wg[0-9]+)/edit/$',
views.EditServerView.as_view(), name='edit-server'),
re_path(r'^apps/wireguard/server/(?P<interface>wg[0-9]+)/delete/$',
views.DeleteServerView.as_view(), name='delete-server'),
]