Code

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12299 closed (invalid)

Inconsistency in Tutorial, part 3.

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

Description

concerns:

Tutorial, Part 3

Decoupling the URLconfs

There is a 'urls.py' file in 'mysite' directory that looks like:

urlpatterns = patterns('mysite.polls.views',
    (r'^polls/$', 'index'),
    (r'^polls/(?P<poll_id>\d+)/$', 'detail'),
    (r'^polls/(?P<poll_id>\d+)/results/$', 'results'),
    (r'^polls/(?P<poll_id>\d+)/vote/$', 'vote'),
)

It is adivsed to copy this file to 'polls' subdirectory, and to modify original file, to make it looks like:

# ...
urlpatterns = patterns('',
    (r'^polls/', include('mysite.polls.urls')),
    # ...

So if now i'll take a look at my site:

Here's what happens if a user goes to "/polls/34/" in this system:

Unfortunatelly there will 'Page not found' appear :(

In my opinion, there shoul be:

Here's what happens if a user goes to "polls/polls/34/" in this system:

otherwise there should be something more removed ('polls') from one of the urls.py files.

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The tutorial tells you remove the leading polls just a couple of lines after it tells you copy the urls.py. It even gives sample code to show what the new urls.py should look like.

comment:2 Changed 4 years ago by tofik

ok, correct, but still i think that it is stated too late ;), but it will be as you want. I just wanted to say that it is not obvious.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.