*: 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 2021-09-15 19:47:55 -07:00 committed by James Valleroy
parent a3e21adc8b
commit cd2b2f5f2c
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
65 changed files with 359 additions and 338 deletions

View File

@ -13,12 +13,12 @@ write the following:
.. code-block:: python3 .. code-block:: python3
:caption: ``urls.py`` :caption: ``urls.py``
from django.conf.urls import url from django.urls import re_path
from .views import TransmissionAppView from .views import TransmissionAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/transmission/$', TransmissionAppView.as_view(), name='index'), re_path(r'^apps/transmission/$', TransmissionAppView.as_view(), name='index'),
] ]
This routes the ``/apps/transmission/`` URL to a view called This routes the ``/apps/transmission/`` URL to a view called

View File

@ -109,8 +109,8 @@ def _include_module_urls(module_import_path, module_name):
url_module = module_import_path + '.urls' url_module = module_import_path + '.urls'
try: try:
urls.urlpatterns += [ urls.urlpatterns += [
django.conf.urls.url( django.urls.re_path(r'',
r'', django.conf.urls.include((url_module, module_name))) django.urls.include((url_module, module_name)))
] ]
except ImportError: except ImportError:
logger.debug('No URLs for %s', module_name) logger.debug('No URLs for %s', module_name)

View File

@ -3,12 +3,13 @@
URLs for the plinth api for android app. URLs for the plinth api for android app.
""" """
from django.conf.urls import url from django.urls import re_path
from stronghold.decorators import public from stronghold.decorators import public
from plinth.modules.api import views from plinth.modules.api import views
urlpatterns = [ urlpatterns = [
url(r'^api/(?P<version>[0-9]+)/shortcuts/?$', public(views.shortcuts)), re_path(r'^api/(?P<version>[0-9]+)/shortcuts/?$', public(views.shortcuts)),
url(r'^api/(?P<version>[0-9]+)/access-info/?$', public(views.access_info)), re_path(r'^api/(?P<version>[0-9]+)/access-info/?$',
public(views.access_info)),
] ]

View File

@ -3,10 +3,10 @@
URLs for the service discovery module. URLs for the service discovery module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^sys/avahi/$', AppView.as_view(app_id='avahi'), name='index'), re_path(r'^sys/avahi/$', AppView.as_view(app_id='avahi'), name='index'),
] ]

View File

@ -3,7 +3,7 @@
URLs for the backups module. URLs for the backups module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import (AddRemoteRepositoryView, AddRepositoryView, from .views import (AddRemoteRepositoryView, AddRepositoryView,
CreateArchiveView, DeleteArchiveView, DownloadArchiveView, CreateArchiveView, DeleteArchiveView, DownloadArchiveView,
@ -12,29 +12,31 @@ from .views import (AddRemoteRepositoryView, AddRepositoryView,
VerifySshHostkeyView, mount_repository, umount_repository) VerifySshHostkeyView, mount_repository, umount_repository)
urlpatterns = [ urlpatterns = [
url(r'^sys/backups/$', IndexView.as_view(), name='index'), re_path(r'^sys/backups/$', IndexView.as_view(), name='index'),
url(r'^sys/backups/(?P<uuid>[^/]+)/schedule/$', ScheduleView.as_view(), re_path(r'^sys/backups/(?P<uuid>[^/]+)/schedule/$', ScheduleView.as_view(),
name='schedule'), name='schedule'),
url(r'^sys/backups/create/$', CreateArchiveView.as_view(), name='create'), re_path(r'^sys/backups/create/$', CreateArchiveView.as_view(),
url(r'^sys/backups/(?P<uuid>[^/]+)/download/(?P<name>[^/]+)/$', name='create'),
DownloadArchiveView.as_view(), name='download'), re_path(r'^sys/backups/(?P<uuid>[^/]+)/download/(?P<name>[^/]+)/$',
url(r'^sys/backups/(?P<uuid>[^/]+)/delete/(?P<name>[^/]+)/$', DownloadArchiveView.as_view(), name='download'),
DeleteArchiveView.as_view(), name='delete'), re_path(r'^sys/backups/(?P<uuid>[^/]+)/delete/(?P<name>[^/]+)/$',
url(r'^sys/backups/upload/$', UploadArchiveView.as_view(), name='upload'), DeleteArchiveView.as_view(), name='delete'),
url(r'^sys/backups/(?P<uuid>[^/]+)/restore-archive/(?P<name>[^/]+)/$', re_path(r'^sys/backups/upload/$', UploadArchiveView.as_view(),
RestoreArchiveView.as_view(), name='restore-archive'), name='upload'),
url(r'^sys/backups/restore-from-upload/$', RestoreFromUploadView.as_view(), re_path(r'^sys/backups/(?P<uuid>[^/]+)/restore-archive/(?P<name>[^/]+)/$',
name='restore-from-upload'), RestoreArchiveView.as_view(), name='restore-archive'),
url(r'^sys/backups/repositories/add/$', AddRepositoryView.as_view(), re_path(r'^sys/backups/restore-from-upload/$',
name='add-repository'), RestoreFromUploadView.as_view(), name='restore-from-upload'),
url(r'^sys/backups/repositories/add-remote/$', re_path(r'^sys/backups/repositories/add/$', AddRepositoryView.as_view(),
AddRemoteRepositoryView.as_view(), name='add-remote-repository'), name='add-repository'),
url(r'^sys/backups/repositories/(?P<uuid>[^/]+)/ssh-verify/$', re_path(r'^sys/backups/repositories/add-remote/$',
VerifySshHostkeyView.as_view(), name='verify-ssh-hostkey'), AddRemoteRepositoryView.as_view(), name='add-remote-repository'),
url(r'^sys/backups/repositories/(?P<uuid>[^/]+)/delete/$', re_path(r'^sys/backups/repositories/(?P<uuid>[^/]+)/ssh-verify/$',
RemoveRepositoryView.as_view(), name='repository-remove'), VerifySshHostkeyView.as_view(), name='verify-ssh-hostkey'),
url(r'^sys/backups/repositories/(?P<uuid>[^/]+)/mount/$', mount_repository, re_path(r'^sys/backups/repositories/(?P<uuid>[^/]+)/delete/$',
name='repository-mount'), RemoveRepositoryView.as_view(), name='repository-remove'),
url(r'^sys/backups/repositories/(?P<uuid>[^/]+)/umount/$', re_path(r'^sys/backups/repositories/(?P<uuid>[^/]+)/mount/$',
umount_repository, name='repository-umount'), mount_repository, name='repository-mount'),
re_path(r'^sys/backups/repositories/(?P<uuid>[^/]+)/umount/$',
umount_repository, name='repository-umount'),
] ]

View File

@ -3,13 +3,13 @@
URLs for the bepasty module. URLs for the bepasty module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import AddPasswordView, BepastyView, remove from .views import AddPasswordView, BepastyView, remove
urlpatterns = [ urlpatterns = [
url(r'^apps/bepasty/$', BepastyView.as_view(), name='index'), re_path(r'^apps/bepasty/$', BepastyView.as_view(), name='index'),
url(r'^apps/bepasty/add/$', AddPasswordView.as_view(), name='add'), re_path(r'^apps/bepasty/add/$', AddPasswordView.as_view(), name='add'),
url(r'^apps/bepasty/(?P<password>[A-Za-z0-9]+)/remove/$', remove, re_path(r'^apps/bepasty/(?P<password>[A-Za-z0-9]+)/remove/$', remove,
name='remove'), name='remove'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the BIND module. URLs for the BIND module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.modules.bind.views import BindAppView from plinth.modules.bind.views import BindAppView
urlpatterns = [ urlpatterns = [
url(r'^sys/bind/$', BindAppView.as_view(), name='index'), re_path(r'^sys/bind/$', BindAppView.as_view(), name='index'),
] ]

View File

@ -3,14 +3,14 @@
URLs for the calibre module. URLs for the calibre module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^apps/calibre/$', views.CalibreAppView.as_view(), name='index'), re_path(r'^apps/calibre/$', views.CalibreAppView.as_view(), name='index'),
url(r'^apps/calibre/library/create/$', views.CreateLibraryView.as_view(), re_path(r'^apps/calibre/library/create/$',
name='create-library'), views.CreateLibraryView.as_view(), name='create-library'),
url(r'^apps/calibre/library/(?P<name>[a-zA-Z0-9_.-]+)/delete/$', re_path(r'^apps/calibre/library/(?P<name>[a-zA-Z0-9_.-]+)/delete/$',
views.delete_library, name='delete-library'), views.delete_library, name='delete-library'),
] ]

View File

@ -3,10 +3,10 @@
URLs for Cockpit module. URLs for Cockpit module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.modules.cockpit.views import CockpitAppView from plinth.modules.cockpit.views import CockpitAppView
urlpatterns = [ urlpatterns = [
url(r'^sys/cockpit/$', CockpitAppView.as_view(), name='index'), re_path(r'^sys/cockpit/$', CockpitAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the Configuration module URLs for the Configuration module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/config/$', views.ConfigAppView.as_view(), name='index'), re_path(r'^sys/config/$', views.ConfigAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the Coturn module. URLs for the Coturn module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import CoturnAppView from .views import CoturnAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/coturn/$', CoturnAppView.as_view(), name='index'), re_path(r'^apps/coturn/$', CoturnAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the date and time module URLs for the date and time module
""" """
from django.conf.urls import url from django.urls import re_path
from .views import DateTimeAppView from .views import DateTimeAppView
urlpatterns = [ urlpatterns = [
url(r'^sys/datetime/$', DateTimeAppView.as_view(), name='index'), re_path(r'^sys/datetime/$', DateTimeAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the Deluge module. URLs for the Deluge module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import DelugeAppView from .views import DelugeAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/deluge/$', DelugeAppView.as_view(), name='index') re_path(r'^apps/deluge/$', DelugeAppView.as_view(), name='index')
] ]

View File

@ -3,12 +3,12 @@
URLs for the Diagnostics module URLs for the Diagnostics module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/diagnostics/$', views.index, name='index'), re_path(r'^sys/diagnostics/$', views.index, name='index'),
url(r'^sys/diagnostics/(?P<app_id>[1-9a-z\-_]+)/$', views.diagnose_app, re_path(r'^sys/diagnostics/(?P<app_id>[1-9a-z\-_]+)/$', views.diagnose_app,
name='app'), name='app'),
] ]

View File

@ -3,11 +3,12 @@
URLs for the diaspora module URLs for the diaspora module
""" """
from django.conf.urls import url from django.urls import re_path
from .views import DiasporaAppView, DiasporaSetupView from .views import DiasporaAppView, DiasporaSetupView
urlpatterns = [ urlpatterns = [
url(r'^apps/diaspora/setup$', DiasporaSetupView.as_view(), name='setup'), re_path(r'^apps/diaspora/setup$', DiasporaSetupView.as_view(),
url(r'^apps/diaspora/$', DiasporaAppView.as_view(), name='index') name='setup'),
re_path(r'^apps/diaspora/$', DiasporaAppView.as_view(), name='index')
] ]

View File

@ -3,12 +3,13 @@
URLs for the dynamicdns module URLs for the dynamicdns module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/dynamicdns/$', views.index, name='index'), re_path(r'^sys/dynamicdns/$', views.index, name='index'),
url(r'^sys/dynamicdns/configure/$', views.configure, name='configure'), re_path(r'^sys/dynamicdns/configure/$', views.configure, name='configure'),
url(r'^sys/dynamicdns/statuspage/$', views.statuspage, name='statuspage'), re_path(r'^sys/dynamicdns/statuspage/$', views.statuspage,
name='statuspage'),
] ]

View File

@ -3,10 +3,10 @@
URL for the Ejabberd module URL for the Ejabberd module
""" """
from django.conf.urls import url from django.urls import re_path
from .views import EjabberdAppView from .views import EjabberdAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/ejabberd/$', EjabberdAppView.as_view(), name='index') re_path(r'^apps/ejabberd/$', EjabberdAppView.as_view(), name='index')
] ]

View File

@ -3,10 +3,10 @@
URLs for the Firewall module URLs for the Firewall module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/firewall/$', views.FirewallAppView.as_view(), name='index'), re_path(r'^sys/firewall/$', views.FirewallAppView.as_view(), name='index'),
] ]

View File

@ -3,15 +3,15 @@
URLs for the First Boot module URLs for the First Boot module
""" """
from django.conf.urls import url from django.urls import re_path
from stronghold.decorators import public from stronghold.decorators import public
from .views import CompleteView, WelcomeView from .views import CompleteView, WelcomeView
urlpatterns = [ urlpatterns = [
# Take care of the firstboot middleware when changing URLs # Take care of the firstboot middleware when changing URLs
url(r'^firstboot/$', public(WelcomeView.as_view()), name='index'), re_path(r'^firstboot/$', public(WelcomeView.as_view()), name='index'),
url(r'^firstboot/welcome/$', public(WelcomeView.as_view()), re_path(r'^firstboot/welcome/$', public(WelcomeView.as_view()),
name='welcome'), name='welcome'),
url(r'^firstboot/complete/$', CompleteView.as_view(), name='complete'), re_path(r'^firstboot/complete/$', CompleteView.as_view(), name='complete'),
] ]

View File

@ -3,19 +3,19 @@
URLs for the Gitweb module. URLs for the Gitweb module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import CreateRepoView, EditRepoView, GitwebAppView, delete from .views import CreateRepoView, EditRepoView, GitwebAppView, delete
urlpatterns = [ urlpatterns = [
url(r'^apps/gitweb/$', GitwebAppView.as_view(), name='index'), re_path(r'^apps/gitweb/$', GitwebAppView.as_view(), name='index'),
url(r'^apps/gitweb/create/$', CreateRepoView.as_view(), name='create'), re_path(r'^apps/gitweb/create/$', CreateRepoView.as_view(), name='create'),
url( re_path(
r'^apps/gitweb/(?P<name>[a-zA-Z0-9-._]+)/edit/$', r'^apps/gitweb/(?P<name>[a-zA-Z0-9-._]+)/edit/$',
EditRepoView.as_view(), EditRepoView.as_view(),
name='edit', name='edit',
), ),
url( re_path(
r'^apps/gitweb/(?P<name>[a-zA-Z0-9-._]+)/delete/$', r'^apps/gitweb/(?P<name>[a-zA-Z0-9-._]+)/delete/$',
delete, delete,
name='delete', name='delete',

View File

@ -3,26 +3,27 @@
URLs for the Help module URLs for the Help module
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.utils import non_admin_view from plinth.utils import non_admin_view
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^help/$', non_admin_view(views.index), name='index'), re_path(r'^help/$', non_admin_view(views.index), name='index'),
url(r'^help/about/$', non_admin_view(views.about), name='about'), re_path(r'^help/about/$', non_admin_view(views.about), name='about'),
url(r'^help/feedback/$', non_admin_view(views.feedback), name='feedback'), re_path(r'^help/feedback/$', non_admin_view(views.feedback),
url(r'^help/support/$', non_admin_view(views.support), name='support'), name='feedback'),
url(r'^help/contribute/$', non_admin_view(views.contribute), re_path(r'^help/support/$', non_admin_view(views.support), name='support'),
name='contribute'), re_path(r'^help/contribute/$', non_admin_view(views.contribute),
url(r'^help/manual/$', non_admin_view(views.manual), name='manual'), name='contribute'),
url(r'^help/manual/(?P<lang>\w*(-\w*)?)/$', non_admin_view(views.manual), re_path(r'^help/manual/$', non_admin_view(views.manual), name='manual'),
name='manual'), re_path(r'^help/manual/(?P<lang>\w*(-\w*)?)/$',
url(r'^help/manual/(?P<lang>\w*(-\w*)?)/(?P<page>[\w-]+)$', non_admin_view(views.manual), name='manual'),
non_admin_view(views.manual), name='manual-page'), re_path(r'^help/manual/(?P<lang>\w*(-\w*)?)/(?P<page>[\w-]+)$',
url(r'^help/manual-download/$', non_admin_view(views.download_manual), non_admin_view(views.manual), name='manual-page'),
name='download-manual'), re_path(r'^help/manual-download/$', non_admin_view(views.download_manual),
url(r'^help/status-log/$', non_admin_view(views.status_log), name='download-manual'),
name='status-log'), re_path(r'^help/status-log/$', non_admin_view(views.status_log),
name='status-log'),
] ]

View File

@ -3,8 +3,10 @@
URLs for the I2P module. URLs for the I2P module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.modules.i2p import views from plinth.modules.i2p import views
urlpatterns = [url(r'^apps/i2p/$', views.I2PAppView.as_view(), name='index')] urlpatterns = [
re_path(r'^apps/i2p/$', views.I2PAppView.as_view(), name='index')
]

View File

@ -3,12 +3,13 @@
URLs for the ikiwiki module URLs for the ikiwiki module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^apps/ikiwiki/$', views.IkiwikiAppView.as_view(), name='index'), re_path(r'^apps/ikiwiki/$', views.IkiwikiAppView.as_view(), name='index'),
url(r'^apps/ikiwiki/(?P<name>.+)/delete/$', views.delete, name='delete'), re_path(r'^apps/ikiwiki/(?P<name>.+)/delete/$', views.delete,
url(r'^apps/ikiwiki/create/$', views.create, name='create'), name='delete'),
re_path(r'^apps/ikiwiki/create/$', views.create, name='create'),
] ]

View File

@ -3,11 +3,11 @@
URLs for the infinoted module. URLs for the infinoted module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^apps/infinoted/$', AppView.as_view(app_id='infinoted'), re_path(r'^apps/infinoted/$', AppView.as_view(app_id='infinoted'),
name='index'), name='index'),
] ]

View File

@ -3,7 +3,7 @@
URLs for the JSXC module URLs for the JSXC module
""" """
from django.conf.urls import url from django.urls import re_path
from stronghold.decorators import public from stronghold.decorators import public
from plinth.views import AppView from plinth.views import AppView
@ -11,6 +11,6 @@ from plinth.views import AppView
from .views import JsxcView from .views import JsxcView
urlpatterns = [ urlpatterns = [
url(r'^apps/jsxc/$', AppView.as_view(app_id='jsxc'), name='index'), re_path(r'^apps/jsxc/$', AppView.as_view(app_id='jsxc'), name='index'),
url(r'^apps/jsxc/jsxc/$', public(JsxcView.as_view()), name='jsxc') re_path(r'^apps/jsxc/jsxc/$', public(JsxcView.as_view()), name='jsxc')
] ]

View File

@ -3,18 +3,18 @@
URLs for the Let's Encrypt module. URLs for the Let's Encrypt module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/letsencrypt/$', views.index, name='index'), re_path(r'^sys/letsencrypt/$', views.index, name='index'),
url(r'^sys/letsencrypt/obtain/(?P<domain>[^/]+)/$', views.obtain, re_path(r'^sys/letsencrypt/obtain/(?P<domain>[^/]+)/$', views.obtain,
name='obtain'), name='obtain'),
url(r'^sys/letsencrypt/re-obtain/(?P<domain>[^/]+)/$', views.reobtain, re_path(r'^sys/letsencrypt/re-obtain/(?P<domain>[^/]+)/$', views.reobtain,
name='re-obtain'), name='re-obtain'),
url(r'^sys/letsencrypt/revoke/(?P<domain>[^/]+)/$', views.revoke, re_path(r'^sys/letsencrypt/revoke/(?P<domain>[^/]+)/$', views.revoke,
name='revoke'), name='revoke'),
url(r'^sys/letsencrypt/delete/(?P<domain>[^/]+)/$', views.delete, re_path(r'^sys/letsencrypt/delete/(?P<domain>[^/]+)/$', views.delete,
name='delete'), name='delete'),
] ]

View File

@ -3,12 +3,12 @@
URLs for the matrix-synapse module. URLs for the matrix-synapse module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import MatrixSynapseAppView, SetupView from .views import MatrixSynapseAppView, SetupView
urlpatterns = [ urlpatterns = [
url(r'^apps/matrixsynapse/setup/$', SetupView.as_view(), name='setup'), re_path(r'^apps/matrixsynapse/setup/$', SetupView.as_view(), name='setup'),
url(r'^apps/matrixsynapse/$', MatrixSynapseAppView.as_view(), re_path(r'^apps/matrixsynapse/$', MatrixSynapseAppView.as_view(),
name='index'), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the mediawiki module. URLs for the mediawiki module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import MediaWikiAppView from .views import MediaWikiAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/mediawiki/$', MediaWikiAppView.as_view(), name='index'), re_path(r'^apps/mediawiki/$', MediaWikiAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the minetest module. URLs for the minetest module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.modules.minetest.views import MinetestAppView from plinth.modules.minetest.views import MinetestAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/minetest/$', MinetestAppView.as_view(), name='index'), re_path(r'^apps/minetest/$', MinetestAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the minidlna Server module. URLs for the minidlna Server module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.modules.minidlna.views import MiniDLNAAppView from plinth.modules.minidlna.views import MiniDLNAAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/minidlna/$', MiniDLNAAppView.as_view(), name='index'), re_path(r'^apps/minidlna/$', MiniDLNAAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,11 @@
URLs for the mldonkey module. URLs for the mldonkey module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^apps/mldonkey/$', AppView.as_view(app_id='mldonkey'), name='index') re_path(r'^apps/mldonkey/$', AppView.as_view(app_id='mldonkey'),
name='index')
] ]

View File

@ -3,17 +3,17 @@
URLs for the monkeysphere module. URLs for the monkeysphere module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/monkeysphere/$', views.index, name='index'), re_path(r'^sys/monkeysphere/$', views.index, name='index'),
url(r'^sys/monkeysphere/(?P<ssh_fingerprint>[0-9A-Za-z:+/]+)/import/$', re_path(r'^sys/monkeysphere/(?P<ssh_fingerprint>[0-9A-Za-z:+/]+)/import/$',
views.import_key, name='import'), views.import_key, name='import'),
url(r'^sys/monkeysphere/(?P<fingerprint>[0-9A-Fa-f]+)/details/$', re_path(r'^sys/monkeysphere/(?P<fingerprint>[0-9A-Fa-f]+)/details/$',
views.details, name='details'), views.details, name='details'),
url(r'^sys/monkeysphere/(?P<fingerprint>[0-9A-Fa-f]+)/publish/$', re_path(r'^sys/monkeysphere/(?P<fingerprint>[0-9A-Fa-f]+)/publish/$',
views.publish, name='publish'), views.publish, name='publish'),
url(r'^sys/monkeysphere/cancel/$', views.cancel, name='cancel'), re_path(r'^sys/monkeysphere/cancel/$', views.cancel, name='cancel'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the Mumble module URLs for the Mumble module
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.modules.mumble.views import MumbleAppView from plinth.modules.mumble.views import MumbleAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/mumble/$', MumbleAppView.as_view(), name='index'), re_path(r'^apps/mumble/$', MumbleAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the name services module URLs for the name services module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/names/$', views.index, name='index'), re_path(r'^sys/names/$', views.index, name='index'),
] ]

View File

@ -3,43 +3,47 @@
URLs for the Network module URLs for the Network module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/networks/$', views.index, name='index'), re_path(r'^sys/networks/$', views.index, name='index'),
url(r'^sys/networks/(?P<uuid>[\w.@+-]+)/show/$', views.show, name='show'), re_path(r'^sys/networks/(?P<uuid>[\w.@+-]+)/show/$', views.show,
url(r'^sys/networks/(?P<uuid>[\w.@+-]+)/edit/$', views.edit, name='edit'), name='show'),
url(r'^sys/networks/(?P<uuid>[\w.@+-]+)/activate/$', views.activate, re_path(r'^sys/networks/(?P<uuid>[\w.@+-]+)/edit/$', views.edit,
name='activate'), name='edit'),
url(r'^sys/networks/(?P<uuid>[\w.@+-]+)/deactivate/$', views.deactivate, re_path(r'^sys/networks/(?P<uuid>[\w.@+-]+)/activate/$', views.activate,
name='deactivate'), name='activate'),
url(r'^sys/networks/scan/$', views.scan, name='scan'), re_path(r'^sys/networks/(?P<uuid>[\w.@+-]+)/deactivate/$',
url(r'^sys/networks/add/$', views.add, name='add'), views.deactivate, name='deactivate'),
url(r'^sys/networks/add/generic/$', views.add_generic, name='add_generic'), re_path(r'^sys/networks/scan/$', views.scan, name='scan'),
url(r'^sys/networks/add/ethernet/$', views.add_ethernet, re_path(r'^sys/networks/add/$', views.add, name='add'),
name='add_ethernet'), re_path(r'^sys/networks/add/generic/$', views.add_generic,
url(r'^sys/networks/add/pppoe/$', views.add_pppoe, name='add_pppoe'), name='add_generic'),
url( re_path(r'^sys/networks/add/ethernet/$', views.add_ethernet,
name='add_ethernet'),
re_path(r'^sys/networks/add/pppoe/$', views.add_pppoe, name='add_pppoe'),
re_path(
r'^sys/networks/add/wifi/(?:(?P<ssid>[^/]+)/' r'^sys/networks/add/wifi/(?:(?P<ssid>[^/]+)/'
r'(?P<interface_name>[^/]+)/)?$', views.add_wifi, name='add_wifi'), r'(?P<interface_name>[^/]+)/)?$', views.add_wifi, name='add_wifi'),
url(r'^sys/networks/(?P<uuid>[\w.@+-]+)/delete/$', views.delete, re_path(r'^sys/networks/(?P<uuid>[\w.@+-]+)/delete/$', views.delete,
name='delete'), name='delete'),
url(r'^sys/networks/router-configuration/$', re_path(r'^sys/networks/router-configuration/$',
views.RouterConfigurationView.as_view(), name='router-configuration'), views.RouterConfigurationView.as_view(),
url(r'^sys/networks/firstboot/router-configuration/$', name='router-configuration'),
views.RouterConfigurationFirstBootView.as_view(), re_path(r'^sys/networks/firstboot/router-configuration/$',
name='router-configuration-first-boot'), views.RouterConfigurationFirstBootView.as_view(),
url(r'^sys/networks/internet-connection-type/$', name='router-configuration-first-boot'),
views.InternetConnectionTypeView.as_view(), re_path(r'^sys/networks/internet-connection-type/$',
name='internet-connection-type'), views.InternetConnectionTypeView.as_view(),
url(r'^sys/networks/firstboot/internet-connection-type/$', name='internet-connection-type'),
views.InternetConnectionTypeFirstBootView.as_view(), re_path(r'^sys/networks/firstboot/internet-connection-type/$',
name='internet-connection-type-first-boot'), views.InternetConnectionTypeFirstBootView.as_view(),
url(r'^sys/networks/network-topology/$', name='internet-connection-type-first-boot'),
views.NetworkTopologyView.as_view(), name='network-topology'), re_path(r'^sys/networks/network-topology/$',
url(r'^sys/networks/firstboot/network-topology-first-boot/$', views.NetworkTopologyView.as_view(), name='network-topology'),
views.NetworkTopologyFirstBootView.as_view(), re_path(r'^sys/networks/firstboot/network-topology-first-boot/$',
name='network-topology-first-boot'), views.NetworkTopologyFirstBootView.as_view(),
name='network-topology-first-boot'),
] ]

View File

@ -3,16 +3,16 @@
URLs for the OpenVPN module. URLs for the OpenVPN module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.utils import user_group_view from plinth.utils import user_group_view
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^apps/openvpn/$', views.OpenVPNAppView.as_view(), name='index'), re_path(r'^apps/openvpn/$', views.OpenVPNAppView.as_view(), name='index'),
url(r'^apps/openvpn/setup/$', views.setup, name='setup'), re_path(r'^apps/openvpn/setup/$', views.setup, name='setup'),
url(r'^apps/openvpn/ecc/$', views.ecc, name='ecc'), re_path(r'^apps/openvpn/ecc/$', views.ecc, name='ecc'),
url(r'^apps/openvpn/profile/$', user_group_view(views.profile, 'vpn'), re_path(r'^apps/openvpn/profile/$', user_group_view(views.profile, 'vpn'),
name='profile'), name='profile'),
] ]

View File

@ -3,14 +3,14 @@
URLs for the PageKite module URLs for the PageKite module
""" """
from django.conf.urls import url from django.urls import re_path
from .views import AddCustomServiceView, ConfigurationView, DeleteServiceView from .views import AddCustomServiceView, ConfigurationView, DeleteServiceView
urlpatterns = [ urlpatterns = [
url(r'^sys/pagekite/$', ConfigurationView.as_view(), name='index'), re_path(r'^sys/pagekite/$', ConfigurationView.as_view(), name='index'),
url(r'^sys/pagekite/services/custom/add/$', AddCustomServiceView.as_view(), re_path(r'^sys/pagekite/services/custom/add/$',
name='add-custom-service'), AddCustomServiceView.as_view(), name='add-custom-service'),
url(r'^sys/pagekite/services/custom/delete/$', DeleteServiceView.as_view(), re_path(r'^sys/pagekite/services/custom/delete/$',
name='delete-custom-service'), DeleteServiceView.as_view(), name='delete-custom-service'),
] ]

View File

@ -3,11 +3,11 @@
FreedomBox app for System Monitoring (cockpit-pcp) in System. FreedomBox app for System Monitoring (cockpit-pcp) in System.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^sys/performance/$', AppView.as_view(app_id='performance'), re_path(r'^sys/performance/$', AppView.as_view(app_id='performance'),
name='index'), name='index'),
] ]

View File

@ -3,12 +3,12 @@
URLs for the power module. URLs for the power module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/power/$', views.index, name='index'), re_path(r'^sys/power/$', views.index, name='index'),
url(r'^sys/power/restart$', views.restart, name='restart'), re_path(r'^sys/power/restart$', views.restart, name='restart'),
url(r'^sys/power/shutdown$', views.shutdown, name='shutdown'), re_path(r'^sys/power/shutdown$', views.shutdown, name='shutdown'),
] ]

View File

@ -3,10 +3,11 @@
URLs for the Privoxy module. URLs for the Privoxy module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^apps/privoxy/$', AppView.as_view(app_id='privoxy'), name='index'), re_path(r'^apps/privoxy/$', AppView.as_view(app_id='privoxy'),
name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the quassel module. URLs for the quassel module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import QuasselAppView from .views import QuasselAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/quassel/$', QuasselAppView.as_view(), name='index'), re_path(r'^apps/quassel/$', QuasselAppView.as_view(), name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the radicale module. URLs for the radicale module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import RadicaleAppView from .views import RadicaleAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/radicale/$', RadicaleAppView.as_view(), name='index'), re_path(r'^apps/radicale/$', RadicaleAppView.as_view(), name='index'),
] ]

View File

@ -3,11 +3,11 @@
URLs for the Roundcube module. URLs for the Roundcube module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^apps/roundcube/$', AppView.as_view(app_id='roundcube'), re_path(r'^apps/roundcube/$', AppView.as_view(app_id='roundcube'),
name='index') name='index')
] ]

View File

@ -3,12 +3,12 @@
URLs for the samba module. URLs for the samba module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^apps/samba/$', views.SambaAppView.as_view(), name='index'), re_path(r'^apps/samba/$', views.SambaAppView.as_view(), name='index'),
url(r'^apps/samba/share/(?P<mount_point>[A-Za-z0-9%_.\-~]+)/$', re_path(r'^apps/samba/share/(?P<mount_point>[A-Za-z0-9%_.\-~]+)/$',
views.share, name='share') views.share, name='share')
] ]

View File

@ -3,10 +3,10 @@
URLs for the Searx module. URLs for the Searx module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import SearxAppView from .views import SearxAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/searx/$', SearxAppView.as_view(), name='index'), re_path(r'^apps/searx/$', SearxAppView.as_view(), name='index'),
] ]

View File

@ -3,11 +3,11 @@
URLs for the security module URLs for the security module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/security/$', views.index, name='index'), re_path(r'^sys/security/$', views.index, name='index'),
url(r'^sys/security/report$', views.report, name='report'), re_path(r'^sys/security/report$', views.report, name='report'),
] ]

View File

@ -3,10 +3,11 @@
URLs for the Shaarli module. URLs for the Shaarli module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^apps/shaarli/$', AppView.as_view(app_id='shaarli'), name='index') re_path(r'^apps/shaarli/$', AppView.as_view(app_id='shaarli'),
name='index')
] ]

View File

@ -3,10 +3,11 @@
URLs for the Shadowsocks module. URLs for the Shadowsocks module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import ShadowsocksAppView from .views import ShadowsocksAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/shadowsocks/$', ShadowsocksAppView.as_view(), name='index'), re_path(r'^apps/shadowsocks/$', ShadowsocksAppView.as_view(),
name='index'),
] ]

View File

@ -3,14 +3,15 @@
URLs for the sharing app. URLs for the sharing app.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import AddShareView, EditShareView, IndexView, remove from .views import AddShareView, EditShareView, IndexView, remove
urlpatterns = [ urlpatterns = [
url(r'^apps/sharing/$', IndexView.as_view(), name='index'), re_path(r'^apps/sharing/$', IndexView.as_view(), name='index'),
url(r'^apps/sharing/add/$', AddShareView.as_view(), name='add'), re_path(r'^apps/sharing/add/$', AddShareView.as_view(), name='add'),
url(r'^apps/sharing/(?P<name>[a-z0-9]+)/edit/$', EditShareView.as_view(), re_path(r'^apps/sharing/(?P<name>[a-z0-9]+)/edit/$',
name='edit'), EditShareView.as_view(), name='edit'),
url(r'^apps/sharing/(?P<name>[a-z0-9]+)/remove/$', remove, name='remove'), re_path(r'^apps/sharing/(?P<name>[a-z0-9]+)/remove/$', remove,
name='remove'),
] ]

View File

@ -3,15 +3,15 @@
URLs for the snapshot module. URLs for the snapshot module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/snapshot/$', views.index, name='index'), re_path(r'^sys/snapshot/$', views.index, name='index'),
url(r'^sys/snapshot/manage/$', views.manage, name='manage'), re_path(r'^sys/snapshot/manage/$', views.manage, name='manage'),
url(r'^sys/snapshot/selected/delete$', views.delete_selected, re_path(r'^sys/snapshot/selected/delete$', views.delete_selected,
name='delete-selected'), name='delete-selected'),
url(r'^sys/snapshot/(?P<number>\d+)/rollback$', views.rollback, re_path(r'^sys/snapshot/(?P<number>\d+)/rollback$', views.rollback,
name='rollback'), name='rollback'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the Secure Shell Server module. URLs for the Secure Shell Server module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.modules.ssh.views import SshAppView from plinth.modules.ssh.views import SshAppView
urlpatterns = [ urlpatterns = [
url(r'^sys/ssh/$', SshAppView.as_view(), name='index'), re_path(r'^sys/ssh/$', SshAppView.as_view(), name='index'),
] ]

View File

@ -3,7 +3,7 @@
URLs for the Single Sign On module. URLs for the Single Sign On module.
""" """
from django.conf.urls import url from django.urls import re_path
from stronghold.decorators import public from stronghold.decorators import public
from plinth.utils import non_admin_view from plinth.utils import non_admin_view
@ -11,8 +11,8 @@ from plinth.utils import non_admin_view
from .views import SSOLoginView, refresh from .views import SSOLoginView, refresh
urlpatterns = [ urlpatterns = [
url(r'^accounts/sso/login/$', public(SSOLoginView.as_view()), re_path(r'^accounts/sso/login/$', public(SSOLoginView.as_view()),
name='sso-login'), name='sso-login'),
url(r'^accounts/sso/refresh/$', non_admin_view(refresh), re_path(r'^accounts/sso/refresh/$', non_admin_view(refresh),
name='sso-refresh'), name='sso-refresh'),
] ]

View File

@ -3,13 +3,13 @@
URLs for the disks module. URLs for the disks module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/storage/$', views.StorageAppView.as_view(), name='index'), re_path(r'^sys/storage/$', views.StorageAppView.as_view(), name='index'),
url(r'^sys/storage/expand$', views.expand, name='expand'), re_path(r'^sys/storage/expand$', views.expand, name='expand'),
url(r'^sys/storage/eject/(?P<device_path>[A-Za-z0-9%_.\-~]+)/$', re_path(r'^sys/storage/eject/(?P<device_path>[A-Za-z0-9%_.\-~]+)/$',
views.eject, name='eject') views.eject, name='eject')
] ]

View File

@ -3,11 +3,11 @@
URLs for the Syncthing module. URLs for the Syncthing module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^apps/syncthing/$', AppView.as_view(app_id='syncthing'), re_path(r'^apps/syncthing/$', AppView.as_view(app_id='syncthing'),
name='index') name='index')
] ]

View File

@ -3,16 +3,16 @@
URLs for the Tahoe-LAFS module. URLs for the Tahoe-LAFS module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
from .views import TahoeAppView, TahoeSetupView from .views import TahoeAppView, TahoeSetupView
urlpatterns = [ urlpatterns = [
url(r'^apps/tahoe/setup/$', TahoeSetupView.as_view(), name='setup'), re_path(r'^apps/tahoe/setup/$', TahoeSetupView.as_view(), name='setup'),
url(r'^apps/tahoe/add_introducer/$', views.add_introducer, re_path(r'^apps/tahoe/add_introducer/$', views.add_introducer,
name='add-introducer'), name='add-introducer'),
url(r'^apps/tahoe/remove_introducer/(?P<introducer>[0-9a-zA-Z_]+)/$', re_path(r'^apps/tahoe/remove_introducer/(?P<introducer>[0-9a-zA-Z_]+)/$',
views.remove_introducer, name='remove-introducer'), views.remove_introducer, name='remove-introducer'),
url(r'^apps/tahoe/$', TahoeAppView.as_view(), name='index') re_path(r'^apps/tahoe/$', TahoeAppView.as_view(), name='index')
] ]

View File

@ -3,10 +3,10 @@
URLs for the Tor module. URLs for the Tor module.
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^apps/tor/$', views.index, name='index'), re_path(r'^apps/tor/$', views.index, name='index'),
] ]

View File

@ -3,10 +3,11 @@
URLs for the Transmission module. URLs for the Transmission module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import TransmissionAppView from .views import TransmissionAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/transmission/$', TransmissionAppView.as_view(), name='index'), re_path(r'^apps/transmission/$', TransmissionAppView.as_view(),
name='index'),
] ]

View File

@ -3,10 +3,10 @@
URLs for the Tiny Tiny RSS module. URLs for the Tiny Tiny RSS module.
""" """
from django.conf.urls import url from django.urls import re_path
from plinth.views import AppView from plinth.views import AppView
urlpatterns = [ urlpatterns = [
url(r'^apps/ttrss/$', AppView.as_view(app_id='ttrss'), name='index') re_path(r'^apps/ttrss/$', AppView.as_view(app_id='ttrss'), name='index')
] ]

View File

@ -3,21 +3,22 @@
URLs for the upgrades module URLs for the upgrades module
""" """
from django.conf.urls import url from django.urls import re_path
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/upgrades/$', views.UpgradesConfigurationView.as_view(), re_path(r'^sys/upgrades/$', views.UpgradesConfigurationView.as_view(),
name='index'), name='index'),
url(r'^sys/upgrades/activate-backports/$', views.activate_backports, re_path(r'^sys/upgrades/activate-backports/$', views.activate_backports,
name='activate-backports'), name='activate-backports'),
url(r'^sys/upgrades/firstboot/backports/$', re_path(r'^sys/upgrades/firstboot/backports/$',
views.BackportsFirstbootView.as_view(), name='backports-firstboot'), views.BackportsFirstbootView.as_view(),
url(r'^sys/upgrades/firstboot/update/$', name='backports-firstboot'),
views.UpdateFirstbootView.as_view(), name='update-firstboot'), re_path(r'^sys/upgrades/firstboot/update/$',
url(r'^sys/upgrades/firstboot/update/progress/$', views.UpdateFirstbootView.as_view(), name='update-firstboot'),
views.UpdateFirstbootProgressView.as_view(), re_path(r'^sys/upgrades/firstboot/update/progress/$',
name='update-firstboot-progress'), views.UpdateFirstbootProgressView.as_view(),
url(r'^sys/upgrades/upgrade/$', views.upgrade, name='upgrade'), name='update-firstboot-progress'),
re_path(r'^sys/upgrades/upgrade/$', views.upgrade, name='upgrade'),
] ]

View File

@ -4,8 +4,7 @@ URLs for the Users module
""" """
from axes.decorators import axes_dispatch from axes.decorators import axes_dispatch
from django.conf.urls import url from django.urls import re_path, reverse_lazy
from django.urls import reverse_lazy
from stronghold.decorators import public from stronghold.decorators import public
from plinth.modules.sso.views import SSOLoginView, SSOLogoutView from plinth.modules.sso.views import SSOLoginView, SSOLogoutView
@ -14,24 +13,24 @@ from plinth.utils import non_admin_view
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^sys/users/$', views.UserList.as_view(), name='index'), re_path(r'^sys/users/$', views.UserList.as_view(), name='index'),
url(r'^sys/users/create/$', views.UserCreate.as_view(), name='create'), re_path(r'^sys/users/create/$', views.UserCreate.as_view(), name='create'),
url(r'^sys/users/(?P<slug>[\w.@+-]+)/edit/$', re_path(r'^sys/users/(?P<slug>[\w.@+-]+)/edit/$',
non_admin_view(views.UserUpdate.as_view()), name='edit'), non_admin_view(views.UserUpdate.as_view()), name='edit'),
url(r'^sys/users/(?P<slug>[\w.@+-]+)/delete/$', views.UserDelete.as_view(), re_path(r'^sys/users/(?P<slug>[\w.@+-]+)/delete/$',
name='delete'), views.UserDelete.as_view(), name='delete'),
url(r'^sys/users/(?P<slug>[\w.@+-]+)/change_password/$', re_path(r'^sys/users/(?P<slug>[\w.@+-]+)/change_password/$',
non_admin_view(views.UserChangePassword.as_view()), non_admin_view(views.UserChangePassword.as_view()),
name='change_password'), name='change_password'),
# Authnz is handled by SSO # Authnz is handled by SSO
# XXX: Use axes authentication backend and middleware instead of # XXX: Use axes authentication backend and middleware instead of
# axes_dispatch after axes 5.x becomes available in Debian stable. # axes_dispatch after axes 5.x becomes available in Debian stable.
url(r'^accounts/login/$', public(axes_dispatch(SSOLoginView.as_view())), re_path(r'^accounts/login/$',
name='login'), public(axes_dispatch(SSOLoginView.as_view())), name='login'),
url(r'^accounts/logout/$', non_admin_view(SSOLogoutView.as_view()), re_path(r'^accounts/logout/$', non_admin_view(SSOLogoutView.as_view()),
{'next_page': reverse_lazy('index')}, name='logout'), {'next_page': reverse_lazy('index')}, name='logout'),
url(r'^users/firstboot/$', public(views.FirstBootView.as_view()), re_path(r'^users/firstboot/$', public(views.FirstBootView.as_view()),
name='firstboot'), name='firstboot'),
] ]

View File

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

View File

@ -3,11 +3,11 @@
URLs for the WordPress module. URLs for the WordPress module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import WordPressAppView from .views import WordPressAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/wordpress/$', WordPressAppView.as_view(app_id='wordpress'), re_path(r'^apps/wordpress/$', WordPressAppView.as_view(app_id='wordpress'),
name='index'), name='index'),
] ]

View File

@ -3,11 +3,11 @@
URLs for the Zoph module. URLs for the Zoph module.
""" """
from django.conf.urls import url from django.urls import re_path
from .views import SetupView, ZophAppView from .views import SetupView, ZophAppView
urlpatterns = [ urlpatterns = [
url(r'^apps/zoph/setup/$', SetupView.as_view(), name='setup'), re_path(r'^apps/zoph/setup/$', SetupView.as_view(), name='setup'),
url(r'^apps/zoph/$', ZophAppView.as_view(app_id='zoph'), name='index') re_path(r'^apps/zoph/$', ZophAppView.as_view(app_id='zoph'), name='index')
] ]

View File

@ -3,13 +3,14 @@
Django URL patterns for running tests. Django URL patterns for running tests.
""" """
from django.conf.urls import url from django.urls import re_path
from django.views.generic import TemplateView from django.views.generic import TemplateView
_test_view = TemplateView.as_view(template_name='index.html') _test_view = TemplateView.as_view(template_name='index.html')
urlpatterns = [ urlpatterns = [
url(r'^$', _test_view, name='index'), re_path(r'^$', _test_view, name='index'),
url(r'^apps/$', _test_view, name='apps'), re_path(r'^apps/$', _test_view, name='apps'),
url(r'^sys/$', _test_view, name='system'), re_path(r'^sys/$', _test_view, name='system'),
url(r'^test/(?P<a>\d+)/(?P<b>\d+)/(?P<c>\d+)/$', _test_view, name='test'), re_path(r'^test/(?P<a>\d+)/(?P<b>\d+)/(?P<c>\d+)/$', _test_view,
name='test'),
] ]

View File

@ -3,7 +3,7 @@
Django URLconf file containing all urls Django URLconf file containing all urls
""" """
from captcha import views as cviews from captcha import views as cviews
from django.conf.urls import url from django.urls import re_path
from stronghold.decorators import public from stronghold.decorators import public
from plinth.modules.sso.views import CaptchaLoginView from plinth.modules.sso.views import CaptchaLoginView
@ -11,27 +11,28 @@ from plinth.modules.sso.views import CaptchaLoginView
from . import views from . import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.index, name='index'), re_path(r'^$', views.index, name='index'),
url(r'^language-selection/$', re_path(r'^language-selection/$',
public(views.LanguageSelectionView.as_view()), public(views.LanguageSelectionView.as_view()),
name='language-selection'), name='language-selection'),
url(r'^apps/$', views.AppsIndexView.as_view(), name='apps'), re_path(r'^apps/$', views.AppsIndexView.as_view(), name='apps'),
url(r'^sys/$', views.system_index, name='system'), re_path(r'^sys/$', views.system_index, name='system'),
# captcha urls are public # captcha urls are public
url(r'^captcha/image/(?P<key>\w+)/$', public(cviews.captcha_image), re_path(r'^captcha/image/(?P<key>\w+)/$', public(cviews.captcha_image),
name='captcha-image', kwargs={'scale': 1}), name='captcha-image', kwargs={'scale': 1}),
url(r'^captcha/image/(?P<key>\w+)@2/$', public(cviews.captcha_image), re_path(r'^captcha/image/(?P<key>\w+)@2/$', public(cviews.captcha_image),
name='captcha-image-2x', kwargs={'scale': 2}), name='captcha-image-2x', kwargs={'scale': 2}),
url(r'^captcha/audio/(?P<key>\w+)/$', public(cviews.captcha_audio), re_path(r'^captcha/audio/(?P<key>\w+)/$', public(cviews.captcha_audio),
name='captcha-audio'), name='captcha-audio'),
url(r'^captcha/refresh/$', public(cviews.captcha_refresh), re_path(r'^captcha/refresh/$', public(cviews.captcha_refresh),
name='captcha-refresh'), name='captcha-refresh'),
# locked url from django-axes # locked url from django-axes
url(r'locked/$', public(CaptchaLoginView.as_view()), name='locked_out'), re_path(r'locked/$', public(CaptchaLoginView.as_view()),
name='locked_out'),
# Notifications # Notifications
url(r'^notification/(?P<id>[A-Za-z0-9-=]+)/dismiss/$', re_path(r'^notification/(?P<id>[A-Za-z0-9-=]+)/dismiss/$',
views.notification_dismiss, name='notification_dismiss') views.notification_dismiss, name='notification_dismiss')
] ]