Code

Opened 2 years ago

Closed 2 years ago

#18311 closed Uncategorized (invalid)

en/dev/topics/auth/ - login.html syntax

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

Description

This line in the sample registration/login.html files is throwing an exception NoReverseMatch:

<form method="post" action="{% url 'django.contrib.auth.views.login' %}">

Removing the single quotes from the url tag fixes it.

Attachments (0)

Change History (1)

comment:1 Changed 2 years ago by russellm

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

It isn't clear exactly which "sample" template you're referring to. However, I'm going to guess you're looking at an example or documentation for 1.5 (i.e., current development branch), and deploying using 1.3 or 1.4.

The "with quotes" syntax is now the preferred syntax for the URL tag. If you're on Django 1.5, it's the only allowed syntax; if you're on Django 1.4 or 1.3, the new syntax can be enabled by adding {% load url from future %} at the top of your template.

Feel free to reopen if you can show a specific location that the new syntax is being suggested in documentation for 1.4 or 1.3 *without* the from future load statement.

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.