[Django] #31740: Part 4 of the tutorial incorrectly uses a namespaced url

7 views
Skip to first unread message

Django

unread,
Jun 24, 2020, 2:43:24 PM6/24/20
to django-...@googlegroups.com
#31740: Part 4 of the tutorial incorrectly uses a namespaced url
-------------------------------------+-------------------------------------
Reporter: maxi-mil | Owner: nobody
Type: Bug | Status: new
Component: | Version: 3.0
Documentation | Keywords: documentation,
Severity: Normal | namespace, error
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
I am new to using Django, but I believe I noticed an error with one of the
urls in a template.

This url is used in the form:

{{{
{% url 'polls:vote' question.id %}
}}}

Despite the path definition:

{{{
path('<int:question_id>/vote/', views.vote, name='vote'),
}}}

When I do the same, I get an error as the namespace doesn't exist. This is
easily fixed by removing the namespace from the template.

https://docs.djangoproject.com/en/3.0/intro/tutorial04/#write-a-minimal-
form

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

Django

unread,
Jun 24, 2020, 3:30:19 PM6/24/20
to django-...@googlegroups.com
#31740: Part 4 of the tutorial incorrectly uses a namespaced url
-------------------------------------+-------------------------------------
Reporter: Max | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 3.0
Severity: Normal | Resolution: invalid
Keywords: documentation, | Triage Stage:
namespace, error | Unreviewed
Has patch: 0 | Needs documentation: 0

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

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


Comment:

Namespacing URL names are already described in
[https://docs.djangoproject.com/en/3.0/intro/tutorial03/#namespacing-url-
names tutorial 03], moreover `app_name` is also included in
[https://docs.djangoproject.com/en/3.0/intro/tutorial03/#namespacing-url-
names Tutorial 4]. All works for me.

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

Reply all
Reply to author
Forward
0 new messages