Opened 3 years ago

Closed 3 years ago

#32666 closed Cleanup/optimization (invalid)

Clarify mysite/urls.py location for tutorial-01

Reported by: Johnson Owned by: nobody
Component: Documentation Version: 3.2
Severity: Normal Keywords: tutorial clarification
Cc: j3.soon@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

According to [this answer on StackOverflow](https://stackoverflow.com/a/29657129/), 82 people accidentally created the mysite/urls.py in the outer mysite directory (mysite/mysite/urls.py) instead of modifying the inner mysite directory (mysite/urls.py) when following [tutorial-01](https://docs.djangoproject.com/en/3.1/intro/tutorial01/).

This PR adds a hint to ask readers to double check the file location. This can help future readers who encounters this issue to follow the tutorial more smoothly (instead of searching on Google to see the StackOverflow post)

Django's [contribution guideline](https://github.com/django/django/blob/main/CONTRIBUTING.rst) suggests to create a Trac ticket here beforehand, so I created a fake PR here: https://github.com/j3soon-pr/django/pull/1

If this clarification is approved, I'll create the formal PR on GitHub.

Change History (1)

comment:1 by Mariusz Felisiak, 3 years ago

Resolution: invalid
Status: newclosed
Type: UncategorizedCleanup/optimization

Thanks for the suggestion, however it's explained multiple times in this tutorial, e.g.

  • "The outer mysite/ root directory is a container for your project. Its name doesn’t matter to Django; you can rename it to anything you like."
  • "mysite/urls.py: The URL declarations for this Django project; a “table of contents” of your Django-powered site. You can read more about URLs in URL dispatcher."

The tutorial also instructs reader to modify an existing mysite/urls.py and not to create a new file:

  • "In mysite/urls.py, add an import for django.urls.include and insert an include() in the urlpatterns list, so you have: ...."

I don't think any further explanation is needed.

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