10000 Fixed #24700 -- Added dash to slug regex in http docs · ddriddle/django@269a5db · GitHub
[go: up one dir, main page]

Skip to content

Commit 269a5db

Browse files
committed
Fixed #24700 -- Added dash to slug regex in http docs
1 parent 8efea1b commit 269a5db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/topics/http/urls.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ prefix is used repeatedly. For example, consider this URLconf::
320320
from . import views
321321

322322
urlpatterns = [
323-
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/history/$', views.history),
324-
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/edit/$', views.edit),
325-
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/discuss/$', views.discuss),
326-
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/permissions/$', views.permissions),
323+
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/history/$', views.history),
324+
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/edit/$', views.edit),
325+
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/discuss/$', views.discuss),
326+
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/permissions/$', views.permissions),
327327
]
328328

329329
We can improve this by stating the common path prefix only once and grouping
@@ -333,7 +333,7 @@ the suffixes that differ::
333333
from . import views
334334

335335
urlpatterns = [
336-
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/', include([
336+
url(r'^(?P<page_slug>[\w-]+)-(?P<page_id>\w+)/', include([
337337
url(r'^history/$', views.history),
338338
url(r'^edit/$', views.edit),
339339
url(r'^discuss/$', views.discuss),

0 commit comments

Comments
 (0)
0