Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#18671 closed Uncategorized (invalid)

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

Reported by: bartek.rychlicki@… Owned by: nobody
Component: Documentation Version: 1.5
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

https://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.views.login
contains a sample login form which will throw
NoReverseMatch: Reverse for django.contrib.auth.views.login with arguments '()' and keyword arguments '{}' not found.

the code:
<form method="post" action="{% url 'django.contrib.auth.views.login' %}">
should be
<form method="post" action="{% url django.contrib.auth.views.login %}">
which fixes the problem

my django is 1.4

Change History (2)

comment:1 by Russell Keith-Magee, 12 years ago

Resolution: invalid
Status: newclosed

You're using the documentation for the development version, but using Django 1.4. If you use the documentation for Django 1.4, you'll see that there is a {% load url from future %} tag required. This is due to a change int he {% url %} tag that we have been phasing in since Django 1.3. See the Django 1.3 release notes for more details.

Last edited 12 years ago by Russell Keith-Magee (previous) (diff)

comment:2 by anonymous, 11 years ago

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