Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#24635 closed Cleanup/optimization (fixed)

New project provides deprecated examples

Reported by: jambonrose Owned by: jambonrose
Component: Core (Management commands) Version: 1.8
Severity: Normal Keywords: startproject templates
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As detailed in the Django 1.8 release notes, namespace strings in URL patterns are considered deprecated.

However, when creating a new project in 1.8 with django-admin startproject, the default template displays:

     url(r'^$', '{{ project_name }}.views.home', name='home'),

The default example provided in project_name/urls.py should follow best practice.

Change History (6)

comment:1 Changed 5 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

There has been some sensitivity to changing the project template late in the release cycle (now it's after the release) since other tutorials rely on it, so maybe we have to limit this fix to 1.9.

comment:2 Changed 5 years ago by Andrew Godwin

I do think this would make sense to backport, though, given that the examples use a deprecated-in-1.8 style; the project template should at least be self-consistent, IMO.

comment:3 Changed 5 years ago by jambonrose

Owner: changed from nobody to jambonrose
Status: newassigned

comment:4 Changed 5 years ago by Tim Graham

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:5 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 0b5abb03:

Fixed #24635 -- Updated deprecated urls.py examples in default project template.

comment:6 Changed 5 years ago by Tim Graham <timograham@…>

In b1d8320:

[1.8.x] Fixed #24635 -- Updated deprecated urls.py examples in default project template.

Backport of 0b5abb03218ff0c575cee0c83e446bab81cbfadd from master

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