#24695 closed Bug (fixed)
URL regex has unnecessary _
Reported by: | Lachlan Musicman | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
On this page:
https://docs.djangoproject.com/en/1.8/ref/class-based-views/generic-display/
Under myapps/urls.py in the DetailView
...
urlpatterns = [ url(r'^(?P<slug>[-_\w]+)/$', ArticleDetailView.as_view(), name='article-detail'), ]
The _ is unnecessary, as it's already in \w
The regex should read
?P<slug>[-\w]+
Note:
See TracTickets
for help on using tickets.
Pull request https://github.com/django/django/pull/4551