[Django] #32871: Issue on documentation: path /articles/2003 does match the urlpattern 'articles/2003/'

6 views
Skip to first unread message

Django

unread,
Jun 21, 2021, 2:18:21 PM6/21/21
to django-...@googlegroups.com
#32871: Issue on documentation: path /articles/2003 does match the urlpattern
'articles/2003/'
-------------------------------------+-------------------------------------
Reporter: Nilo | Owner: nobody
César Teixeira |
Type: Bug | Status: new
Component: Core | Version: 3.2
(URLs) | Keywords: urlpatterns, path,
Severity: Normal | ending URL slash, redirection
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
[https://docs.djangoproject.com/en/3.2/topics/http/urls/#example] says:

/articles/2003 would not match any of these patterns, because each
pattern requires that the URL end with a slash.

But in django 3.2.4, this seems wrong:


[21/Jun/2021 15:12:09] "GET /articles/2003 HTTP/1.1" 301 0
[21/Jun/2021 15:12:09] "GET /articles/2003/ HTTP/1.1" 200 765

There's a redirect to the correct URL.

So, is documentation wrong ?

Thanks in advance.

--
Ticket URL: <https://code.djangoproject.com/ticket/32871>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 22, 2021, 2:43:19 AM6/22/21
to django-...@googlegroups.com
#32871: Issue on documentation: path /articles/2003 does match the urlpattern
'articles/2003/'
-------------------------------------+-------------------------------------
Reporter: Nilo César Teixeira | Owner: nobody
Type: Bug | Status: closed
Component: Core (URLs) | Version: 3.2
Severity: Normal | Resolution: invalid
Keywords: urlpatterns, path, | Triage Stage:
ending URL slash, redirection | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => invalid


Comment:

The URL **doesn't** match, but
[https://docs.djangoproject.com/en/3.2/ref/settings/#append-slash
APPEND_SLASH] is enabled by default, so the redirect to the URL that does
match is issued.

--
Ticket URL: <https://code.djangoproject.com/ticket/32871#comment:1>

Reply all
Reply to author
Forward
0 new messages