That’s not an accurate statement.
The name parameter (it’s not a function) is a name for a url, that’s all.
That’s not what those docs are saying.
In the tutorial, you’re creating urls for the polls app. These urls are defined in step 3, in the section:
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"),
]
Notice that you’re only specifying the part of the url after polls - because the name polls is defined in your root urls.py file like this:
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path("polls/", include("polls.urls")),
^^^^^
path("admin/", admin.site.urls),
]
What the docs are saying is that the polls above doesn’t need to be polls. You can change that name to anything you want it to be (as long as it’s a valid url), and your application would still work.
In fact, you could have:
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path("polls/", include("polls.urls")),
path("my-polls/", include("polls.urls")),
path("admin/", admin.site.urls),
]
and you can then access views.detail for question_id 1 as either /polls/1/ or /my-polls/1/.