summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Marillonnet <pmarillonnet@entrouvert.com>2022-04-19 09:22:19 (GMT)
committerPaul Marillonnet <pmarillonnet@entrouvert.com>2022-04-20 07:54:05 (GMT)
commitb4704b16c925e9ab9f13ba65d51af778affe04e7 (patch)
treedc8ae77064215e4eb1f2ef089e8f7d141b796906
parent509beeb6c4863215f79f3127e333048bee2827d1 (diff)
downloaddjango-mellon-b4704b16c925e9ab9f13ba65d51af778affe04e7.zip
django-mellon-b4704b16c925e9ab9f13ba65d51af778affe04e7.tar.gz
django-mellon-b4704b16c925e9ab9f13ba65d51af778affe04e7.tar.bz2
use django3.2-compatible re_path urls util (#64309)
-rw-r--r--mellon/urls.py10
-rw-r--r--tests/urls_tests.py6
-rw-r--r--tests/urls_tests_template_base.py6
-rw-r--r--tests/urls_tests_template_hook.py6
4 files changed, 14 insertions, 14 deletions
diff --git a/mellon/urls.py b/mellon/urls.py
index 0e44152..2020355 100644
--- a/mellon/urls.py
+++ b/mellon/urls.py
@@ -1,11 +1,11 @@
import django
-from django.conf.urls import url
+from django.urls import re_path
from . import views
urlpatterns = [
- url('login/$', views.login, name='mellon_login'),
- url('login/debug/$', views.debug_login, name='mellon_debug_login'),
- url('logout/$', views.logout, name='mellon_logout'),
- url('metadata/$', views.metadata, name='mellon_metadata'),
+ re_path('login/$', views.login, name='mellon_login'),
+ re_path('login/debug/$', views.debug_login, name='mellon_debug_login'),
+ re_path('logout/$', views.logout, name='mellon_logout'),
+ re_path('metadata/$', views.metadata, name='mellon_metadata'),
]
diff --git a/tests/urls_tests.py b/tests/urls_tests.py
index 233848c..73f6e7e 100644
--- a/tests/urls_tests.py
+++ b/tests/urls_tests.py
@@ -13,8 +13,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls import include, url
from django.http import HttpResponse
+from django.urls import include, re_path
def homepage(request):
@@ -22,6 +22,6 @@ def homepage(request):
urlpatterns = [
- url('^', include('mellon.urls')),
- url('^$', homepage, name='homepage'),
+ re_path('^', include('mellon.urls')),
+ re_path('^$', homepage, name='homepage'),
]
diff --git a/tests/urls_tests_template_base.py b/tests/urls_tests_template_base.py
index d800036..21f4d1a 100644
--- a/tests/urls_tests_template_base.py
+++ b/tests/urls_tests_template_base.py
@@ -13,8 +13,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls import include, url
from django.http import HttpResponse
+from django.urls import include, re_path
def homepage(request):
@@ -22,6 +22,6 @@ def homepage(request):
urlpatterns = [
- url('^', include('mellon.urls'), kwargs={'template_base': 'theme.html'}),
- url('^$', homepage, name='homepage'),
+ re_path('^', include('mellon.urls'), kwargs={'template_base': 'theme.html'}),
+ re_path('^$', homepage, name='homepage'),
]
diff --git a/tests/urls_tests_template_hook.py b/tests/urls_tests_template_hook.py
index 716c4d9..adb916d 100644
--- a/tests/urls_tests_template_hook.py
+++ b/tests/urls_tests_template_hook.py
@@ -13,8 +13,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from django.conf.urls import include, url
from django.http import HttpResponse
+from django.urls import include, re_path
def homepage(request):
@@ -26,7 +26,7 @@ def context_hook(context):
urlpatterns = [
- url(
+ re_path(
'^',
include('mellon.urls'),
kwargs={
@@ -34,5 +34,5 @@ urlpatterns = [
'context_hook': context_hook,
},
),
- url('^$', homepage, name='homepage'),
+ re_path('^$', homepage, name='homepage'),
]