﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33249	Writing your first Django app, part 3, Initial Path missing '/'	Eric Jonathan	nobody	"O/S: Windows 10
Python Version 3.10.0
Django 3.2.8

Following the tutorial at the ""Writing your first Django app, part 3"" (https://docs.djangoproject.com/en/3.2/intro/tutorial03/),
at the:
  poll/urls.py
example, currently, it's


{{{
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'),
]
}}}

With error:
Page not found (404)
Request Method:	GET
Request URL:	http://localhost:8000/polls/6/
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

polls [name='index']
polls <int:question_id>/ [name='detail']
polls <int:question_id>/results/ [name='results']
polls <int:question_id>/vote/ [name='vote']
admin/
The current path, polls/6/, didn’t match any of these.

You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

It should be:

{{{
urlpatterns = [
    path('', views.index, name='index'),
    path('/<int:question_id>/', views.detail, name='detail'),
    path('/<int:question_id>/results/', views.results, name='results'),
    path('/<int:question_id>/vote/', views.vote, name='vote'),
]
}}}

With result:

You're looking at question 6.





"	Bug	closed	Documentation	3.2	Normal	invalid			Unreviewed	0	0	0	0	0	0
