Code

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#17538 closed Bug (fixed)

default URLconf import is wrong

Reported by: matt@… Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Tutorial 3 has the following sentence:

By default, URLconfs have the following line up top:

from django.conf.urls.defaults import *

But in the urls.pl generated for me it did not have that but rather had:

from django.conf.urls.defaults import patterns, include, url

Attachments (0)

Change History (5)

comment:1 Changed 2 years ago by aaugustin

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

You are probably using a version of the docs that doesn't match your version of Django.

Last edited 2 years ago by aaugustin (previous) (diff)

comment:2 Changed 2 years ago by carljm

  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Bug

No, unlike those other reports, this one's an actual bug in the tutorial, both the trunk and the 1.3 version.

In both trunk and 1.3, the generated urls.py does not use "import *", and there is a built-in default for handler404 (so it's not necessary to have a handler404 in root urls.py at all). The "Write a 404 (page not found) view" section of tutorial part 3 is wrong in the 1.3 docs because it says the default line includes the "*"; in the dev docs the "*" was replaced with "patterns, url, include". But in both versions that section is simply wrong, because the default handler404 doesn't depend on any import at all anymore.

Thanks for the report, Matt!

comment:3 Changed 2 years ago by aaugustin

So much for late night triage :/ Please accept my apologies.

comment:4 Changed 2 years ago by carljm

  • Resolution set to fixed
  • Status changed from reopened to closed

In [17369]:

Fixed #17538 -- corrected the section in tutorial 3 about the handler404 default. Thanks matt at brozowski dot com for the report.

comment:5 Changed 2 years ago by carljm

In [17370]:

Fixed #17538 -- corrected the section in tutorial 3 about the handler404 default. Thanks matt at brozowski dot com for the report.

Backport of r17369 from trunk.

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.