From 70e57e415504370ac1dc040962e7a820796596cf Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Fri, 4 May 2018 12:19:54 +1000 Subject: [PATCH] Port the urls for lemonauth, lemonshort, micropub, and wellknowns to path() --- lemonauth/urls.py | 12 ++++++------ lemonshort/urls.py | 4 ++-- micropub/urls.py | 4 ++-- wellknowns/urls.py | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lemonauth/urls.py b/lemonauth/urls.py index efeabc0..0e4d9a7 100644 --- a/lemonauth/urls.py +++ b/lemonauth/urls.py @@ -1,11 +1,11 @@ -from django.conf.urls import url +from django.urls import path from . import views app_name = 'lemonauth' urlpatterns = [ - url('^login$', views.login, name='login'), - url('^logout$', views.logout, name='logout'), - url('^indie$', views.IndieView.as_view(), name='indie'), - url('^indie/approve$', views.indie_approve, name='indie_approve'), - url('^token$', views.TokenView.as_view(), name='token'), + path('login', views.login, name='login'), + path('logout', views.logout, name='logout'), + path('indie', views.IndieView.as_view(), name='indie'), + path('indie/approve', views.indie_approve, name='indie_approve'), + path('token', views.TokenView.as_view(), name='token'), ] diff --git a/lemonshort/urls.py b/lemonshort/urls.py index 61fbe05..4f03b26 100644 --- a/lemonshort/urls.py +++ b/lemonshort/urls.py @@ -1,10 +1,10 @@ from django.conf import settings -from django.conf.urls import url +from django.urls import path from .views import unshort app_name = 'lemonshort' urlpatterns = tuple( - url(r'^{0!s}(?P\w+)$'.format(k), unshort, kwargs={'model': m}) + path('{0!s}'.format(k), unshort, name=m, kwargs={'model': m}) for k, m in settings.SHORTEN_MODELS.items() ) diff --git a/micropub/urls.py b/micropub/urls.py index b6c48bb..37753ed 100644 --- a/micropub/urls.py +++ b/micropub/urls.py @@ -1,7 +1,7 @@ -from django.conf.urls import url +from django.urls import path from . import views app_name = 'micropub' urlpatterns = ( - url('^$', views.micropub, name='micropub'), + path('', views.micropub, name='micropub'), ) diff --git a/wellknowns/urls.py b/wellknowns/urls.py index cf24570..2b1b99f 100644 --- a/wellknowns/urls.py +++ b/wellknowns/urls.py @@ -1,12 +1,12 @@ -from django.conf.urls import url +from django.urls import path from . import views app_name = 'wellknowns' urlpatterns = [ - url(r'^keybase.txt$', views.keybase, name='keybase'), - url(r'^host-meta$', views.host_meta_xml, name='host-meta'), - url(r'^host-meta.json$', views.host_meta_json, name='host-meta.json'), - url(r'^manifest.json$', views.manifest, name='manifest'), - url(r'^webfinger$', views.webfinger, name='webfinger'), + path('keybase.txt', views.keybase, name='keybase'), + path('host-meta', views.host_meta_xml, name='host-meta'), + path('host-meta.json', views.host_meta_json, name='host-meta.json'), + path('manifest.json', views.manifest, name='manifest'), + path('webfinger', views.webfinger, name='webfinger'), ]