#31554: tutorial 01: mysite/urls.py location confusion
------------------------------------------------+------------------------
Reporter: Paweł Brodacki | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 3.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
Hi guys,
Working through the 2.2 tutorial I got momentarily stuck at
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 got was a 404. Debug information of the built-in web server
indicated that it wasn't aware of the `polls/` path. Copy-paste of .py
code from the tutorial to the editor didn't help.
The issue was I created `urls.py` in the //outer// (`/somepath/mysite/`),
and not the //inner// (`/somepath/mysite/mysite`) mysite directory. Once
I understood what the problem was, the web server error message made
sense, which was nice ;)
Documentation is consistent, in a sense that it tells the reader to create
urls.py as `polls/urls.py` and then as `mysite/urls.py`, so it can be
concluded that the author meant `mysite/polls` and `mysite/mysite`,
respectively. However, the fact, that django uses the same directory name
at two levels is a trap for newbies.
I would like to propose two possible fixes to this issue:
1. After the contents of mysite/urls.py file add //Your mysite directory
should now look like:(…) // followed by the directory listing, similarly
to how polls/ directory content is shown earlier in the tutorial.
2. Add //'If you see `Not Found: /polls/` error message in the server
output then there's a problem with your mysite/urls.py file. Make sure you
edited the file in the inner //mysite// directory (at the same filesystem
level as the //polls// directory). //, or similar text to the "Page not
found" help inset.
Any of them should help the stray reader.
Other versions of the tutorial (I checked 3.0 and dev) use the same
wording and might benefit from the change.
--
Ticket URL: <https://code.djangoproject.com/ticket/31554>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.eb89963f01dab95dc8d55bfccaf5e682%40djangoproject.com.