#24700: Some documentation examples incorrectly use \w to match against slugs in
URLs
------------------------------------------------+------------------------
Reporter: bmispelon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
On https://docs.djangoproject.com/en/dev/topics/http/urls/#including-
other-urlconfs (found with `git grep -IF \\w -- docs/`), slugs are matched
using `\w+`, like so:
{{{
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/history/$', views.history),
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/edit/$', views.edit),
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/discuss/$', views.discuss),
url(r'^(?P<page_slug>\w+)-(?P<page_id>\w+)/permissions/$',
views.permissions),
}}}
This is incorrect, since slugs can also contain dashes (`-`) so `[\w-]+`
should be used instead.
--
Ticket URL: <https://code.djangoproject.com/ticket/24700>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.c7fe3b2e979603d510d54082a70891f8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.