From df41b5a05d4e00e80e73afe629072e37873e767a Mon Sep 17 00:00:00 2001 From: Sjoerd Job Postmus Date: Thu, 20 Oct 2016 19:29:04 +0200 Subject: Fixed #28593 -- Added a simplified URL routing syntax per DEP 0201. Thanks Aymeric Augustin for shepherding the DEP and patch review. Thanks Marten Kenbeek and Tim Graham for contributing to the code. Thanks Tom Christie, Shai Berger, and Tim Graham for the docs. --- docs/ref/utils.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/ref/utils.txt') diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 240cb80485..55a733f376 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -823,8 +823,8 @@ appropriate entities. from django.utils.translation import pgettext_lazy urlpatterns = [ - url(format_lazy(r'{person}/(?P\d+)/$', person=pgettext_lazy('URL', 'person')), - PersonDetailView.as_view()), + path(format_lazy('{person}//', person=pgettext_lazy('URL', 'person')), + PersonDetailView.as_view()), ] This example allows translators to translate part of the URL. If "person" -- cgit v1.3