[Django] #35490: Writing your first Django app, part 3

14 views
Skip to first unread message

Django

unread,
May 29, 2024, 4:25:24 PM5/29/24
to django-...@googlegroups.com
#35490: Writing your first Django app, part 3
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Huis |
Type: | Status: new
Cleanup/optimization |
Component: | Version: 5.0
Uncategorized |
Severity: Normal | Keywords: tutorial03
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I think the code in a example needs to be adjusted.

Under "Writing more views¶"

from django.urls import path

from . import views

urlpatterns = [
# ex: /polls/
path("", views.index, name="index"),
# ex: /polls/5/
path("<int:question_id>/", views.detail, name="detail"),
# ex: /polls/5/results/
path("<int:question_id>/results/", views.results, name="results"),
# ex: /polls/5/vote/
path("<int:question_id>/vote/", views.vote, name="vote"),
]

I think it should be:

from django.urls import path

from . import views

urlpatterns = [
# ex: /polls/
path("", views.index, name="index"),
# ex: /polls/5/
path("**polls/**<int:question_id>/", views.detail, name="detail"),
# ex: /polls/5/results/
path("**polls/**<int:question_id>/results/", views.results,
name="results"),
# ex: /polls/5/vote/
path("**polls/**<int:question_id>/vote/", views.vote, name="vote"),
]

the polls page wasnt added.
--
Ticket URL: <https://code.djangoproject.com/ticket/35490>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 29, 2024, 5:43:27 PM5/29/24
to django-...@googlegroups.com
#35490: Writing your first Django app, part 3
-------------------------------------+-------------------------------------
Reporter: Michael Huis | Owner: sammy20d
Type: | Status: assigned
Cleanup/optimization |
Component: Uncategorized | Version: 5.0
Severity: Normal | Resolution:
Keywords: tutorial03 | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by sammy20d):

* owner: nobody => sammy20d
* status: new => assigned

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

Django

unread,
May 29, 2024, 7:00:26 PM5/29/24
to django-...@googlegroups.com
#35490: Writing your first Django app, part 3
-------------------------------+--------------------------------------
Reporter: Michael Huis | Owner: sammy20d
Type: Bug | Status: closed
Component: Documentation | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: tutorial03 | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => Documentation
* resolution: => invalid
* status: assigned => closed
* type: Cleanup/optimization => Bug

Comment:

The polls prefix comes from `mysite/urls.py`. See tutorial 1.
--
Ticket URL: <https://code.djangoproject.com/ticket/35490#comment:2>
Reply all
Reply to author
Forward
0 new messages