Ah. I didn't notice that I was using the dev documentation. Thanks!
On 5/14/12 10:04 AM, Alasdair Nicol wrote:
Hi Joseph,
On 14/05/12 14:26, Joseph Mornin wrote:
Hi,
I noticed a possible bug in the Django documentation. The
authentication docs (athttps://docs.djangoproject.com/en/dev/topics/auth/)
include this sample code for registration/login.html:http://dpaste.com/747993/
Running this code gives me this error:
###
TemplateSyntaxError at /login
Caught NoReverseMatch while rendering: Reverse for
''django.contrib.auth.views.login'' with arguments '()' and keyword
arguments '{}' not found.
###
I was able to fix this by removing the quotes around the url parameter
on line 9 (with help from this StackOverflow question:
http://stackoverflow.com/questions/4578685/noreversematch-while-rendering-reverse-for-django-contrib-auth-views-login).
Hope this is useful.
Cheers,
J.
In earlier versions of Django, the url tag did not use quotes. Starting
in Django 1.3, this was gradually changed so that the url tag was
consistent with other tags. The change is described in the release notes
for Django 1.3 [1]
The url you link to is for the development version of Django. If you
look at the same page for Django 1.4 [2], you'll see that the template
includes the following statement.
{% load url from future %}
If you don't include this, then the alternative is to remove the quotes,
as you found.
Hope that explains things.
Cheers,
Alasdair
https://docs.djangoproject.com/en/dev/releases/1.3/#changes-to-url-and-ssi
https://docs.djangoproject.com/en/1.4/topics/auth/
--
Alasdair Nicol
Developer, MEMSET
mail:alasd...@memset.com
web:http://www.memset.com/
Memset Ltd., registration number 4504980. 25 Frederick Sanger Road, Guildford,
Surrey, GU2 7YD, UK.
--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.