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

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018fc607509e-c0ad446a-bc05-4e5f-a81a-93be3e4fe0e8-000000%40eu-central-1.amazonses.com.

Reply via email to