Opened 3 years ago

Closed 3 years ago

Last modified 16 months 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 Changed 3 years ago by russellm

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

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 3 years ago by russellm (previous) (diff)

comment:2 Changed 16 months ago by anonymous

  • Version changed from 1.4 to 1.5
Note: See TracTickets for help on using tickets.
Back to Top