django / djangoproject.com

Source code to djangoproject.com

Home Page:https://www.djangoproject.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible confusion in the docs' tutorial 1

n1colassilva opened this issue · comments

In following tutorial01 from the docs users may run into confusion relating to knowing where to put code, specifically in this step:

The next step is to point the root URLconf at the polls.urls module. In mysite/urls.py, add an import for django.urls.include and insert an include() in the urlpatterns list, so you have:

from django.contrib import admin
from django.urls import include, path

urlpatterns = [
   path("polls/", include("polls.urls")),
   path("admin/", admin.site.urls),
]

The user might think that he's supposed to go to the project and create a urls file and insert that code instead of going into mysite/mysite/urls

Possible solutions

  1. In the code blocks use an absolute path, as in, instead of "polls/urls.py" write "mysite/polls/urls.py". I think this may cause confusion elsewhere as now a reader may think its supposed to be under "mysite/mysite", ill still leave this on the table.
  2. Add one of those info blocks or make it clearer in the documentation that you are supposed to add the code to "mysite/mysite/urls.py"

This is the wrong issue tracker (use https://code.djangoproject.com for documentation issues), however, the linked PR above was also closed.