Opened 2 months ago

Closed 2 months ago

#35379 closed Uncategorized (invalid)

Possible error in documentation

Reported by: NobitaNoobie Owned by: nobody
Component: Documentation Version: 5.0
Severity: Normal Keywords: Documentation fault
Cc: NobitaNoobie Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

With reference to the tutorial: https://docs.djangoproject.com/en/5.0/intro/tutorial01/
While running the demo polls app in my development server I received the following error message:
Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:

polls/
admin/
The empty path didn’t match any of these.

But when I changed the mysite\urls, likeso,
urlpatterns = [

path("", include("polls.urls")),
path("admin/", admin.site.urls),

]

I was able to display the desired response. Please check!

Change History (1)

comment:1 by Sarah Boyce, 2 months ago

Resolution: invalid
Status: newclosed

Hello! Thank you for trying out Django (it's my favourite framework, hope you like it)

In these docs it says:

Go to http://localhost:8000/polls/ in your browser, and you should see the text “Hello, world. You’re at the polls index.”, which you defined in the index view.

What I suspect is you've gone to http://localhost:8000/ (the page that used to show a rocket). The way you've updated the urlpatterns means would (as you said) show you the desired response at http://localhost:8000/

We also have an explicit note in the docs about that 'Page not found error'

If you get an error page here, check that you’re going to http://localhost:8000/polls/ and not http://localhost:8000/.

So good news, you're not the only person who thought they found an issue here, but I will close this ticket as there isn't a bug in the docs and I think the warning note is quite clear.

In future, you might want to use our user support channels if you come across something in your journey with Django. These are the best places to get support 👍

Note: See TracTickets for help on using tickets.
Back to Top