Sunday, May 30, 2010

Re: Built in password reset views resulting in Caught NoReverseMatch while rendering: Reverse for 'django.contrib.auth.views.password_reset_confirm'

Simon

Have considered the sequence in which templates are loaded?

See http://docs.djangoproject.com/en/dev/ref/settings/

If you put the filesystem template loader ahead of the app_directories
django will find your own versions named identically with django
versions and use them instead.

TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
)

hth

Mike

On 30/05/2010 11:49pm, Cromulent wrote:
> Well I got it working by changing the names of my templates to
> something other than the default value. This seems like a bug to me.
> Surely Django should use a provided template if it is available and
> only fall back on the built in ones as an absolute last resort?
> Especially as I had specified in the dictionary the correct template
> name and that they were available.
>
> On May 30, 10:41 am, Cromulent<simon.con...@googlemail.com> wrote:
>> I'm using Django 1.2.1 on Mac OS X with Python 2.6.1 if that matters.
>> I've read the documentation and this is what I have for my urls.py
>> file:
>>
>> password_reset_dict = {
>> 'post_reset_redirect' : '/profiles/login/',
>> 'email_template_name' : 'registration/password_reset_email.html',
>> 'template_name' : 'registration/password_reset_form.html',
>>
>> }
>>
>> password_reset_confirm_dict = {
>> 'template_name' : 'registration/password_reset_confirm.html',
>> 'post_reset_redirect':'/profiles/login/',
>>
>> }
>>
>> (r'^reset/$', 'django.contrib.auth.views.password_reset',
>> password_reset_dict),
>>
>> (r'^reset/confirm/$',
>> 'django.contrib.auth.views.password_reset_confirm', \
>> password_reset_confirm_dict),
>>
>> (r'^reset/done/$', 'django.contrib.auth.views.password_reset_done'),
>>
>> (r'^reset/complete/$',
>> 'django.contrib.auth.views.password_reset_complete'),
>>
>> The strange thing is that when the error comes back the generic view
>> does not seem to be using the templates that I have specified in the
>> dictionary, instead the error points to the internal
>> password_reset_email.html template and this line in particular:
>>
>> {{ protocol }}://{{ domain }}{% url
>> django.contrib.auth.views.password_reset_confirm uidb36=uid
>> token=token %}
>>
>> I've done a fair bit of Googling and tried the various methods
>> mentioned but the ones that seemed most promising require you to
>> change the template and as it does not actually get to my template I'm
>> at a bit of a loss.
>>
>> Can anyone tell me where I am going wrong with this at all?
>>
>> Any help is very much appreciated.
>

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment