Description: Fix compatibility with Django 4 by replacing django.conf.urls with re_path As of Django 4, the django.conf.urls.url() function was removed. The recommended replacement is to use re_path for url paths that use regex. This patch replaces instances of the url function accordingly. Author: Lena Voytek Last-Update: 2023-08-08 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/menu_generator/tests/urls.py +++ b/menu_generator/tests/urls.py @@ -1,11 +1,11 @@ -from django.conf.urls import url +from django.urls import re_path def testview(request): return 'foo' urlpatterns = [ - url(r'named-url', lambda: 'foo', name='named_url'), - url(r'named-with-params/(?P\d+)/', lambda: 'foo', name='named_with_params'), - url(r'known-view', testview, name='known_view'), - url(r'', lambda: 'foo'), + re_path(r'named-url', lambda: 'foo', name='named_url'), + re_path(r'named-with-params/(?P\d+)/', lambda: 'foo', name='named_with_params'), + re_path(r'known-view', testview, name='known_view'), + re_path(r'', lambda: 'foo'), ]