Sunil Mohan Adapa cd2b2f5f2c
*: 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>
2021-09-20 16:50:47 -04:00

29 lines
1.3 KiB
Python

# SPDX-License-Identifier: AGPL-3.0-or-later
"""
URLs for the wireguard module.
"""
from django.urls import re_path
from plinth.modules.wireguard import views
urlpatterns = [
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'),
]