#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.