Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19419 closed Bug (invalid)

Error in login template example

Reported by: Alexander Lyabah 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

https://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.views.login

{% url 'django.contrib.auth.views.login' %} should be {% url django.contrib.auth.views.login %}

( without quotes )

Change History (3)

comment:1 Changed 4 years ago by Claude Paroz

Resolution: invalid
Status: newclosed

comment:2 Changed 4 years ago by Alexander Lyabah

so maybe an error with url tag?

python 2.7 Django 1.4.2

{% url django.contrib.auth.views.login %} - works

{% url 'django.contrib.auth.views.login' %} - exception

Exception Value:
Reverse for django.contrib.auth.views.login with arguments '()' and keyword arguments '{}' not found.

( in exception value 2 single quotes in one side and 2 single quotes in another side of the name of function )

And this is how it add in urls.py

(r'^accounts/login/$', 'django.contrib.auth.views.login'),

comment:3 Changed 4 years ago by Aymeric Augustin

Add {% load url from future %} at the top of your template.

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