Code

Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#18625 closed Bug (fixed)

Docs contain examples that use old-style {% url %} syntax

Reported by: russellm Owned by: nobody
Component: Documentation Version: master
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Via Per-Olof Åstrand on django-users:

The Django docs on named URLs contains an example that uses the old-style URL tag syntax. From https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns :

{% url arch-summary 1945 %}
{% url full-archive 2007 %}

Should read:

{% url "arch-summary" 1945 %}
{% url "full-archive" 2007 %}

(i.e., the URL tag arguments should be quoted).

I doubt this is the only example in the docs where this slip occurs; 1.5 is the first Django version where the new-style syntax is mandatory, so we should audit the docs and look for any other old-style examples that need to be updated.

Attachments (0)

Change History (4)

comment:1 Changed 21 months ago by Aymeric Augustin <aymeric.augustin@…>

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

In [fb46f243b4c48ab42ed2f33a2636f7c33f5861a9]:

Fixed #18625 -- Removed old-style use of url tag

from the documentation.

comment:2 Changed 21 months ago by aaugustin

The audit was performed with a search for \{% url [^'"] in the docs source tree.

comment:3 Changed 21 months ago by aastrand

I think this should be backported to 1.4.

comment:4 Changed 21 months ago by russellm

No, this should *not* be ported back to 1.4. In 1.4, the old style syntax was still the correct default; the new style syntax was an opt-in. If we were to use the new style syntax in the 1.4 docs, we'd have to explain the change every time the url tag was used.

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.