Django-nonrel + Django-registration problem: unexpected keyword argument 'uidb36' when resetting password

Viewed 6140

I'm using Django-nonrel with registration app. Things seem to be working fine, except when I try to reset my password. When clicking on reset-password link sent to me in email, Django produces error message:

password_reset_confirm() got an unexpected keyword argument 'uidb36'

My question: has anybody seen it and knows what's the cure?

EDIT:

The problem is caused by registration\auth_urls.py - they duplicate entries in django\contrib\auth\urls.py, circumwenting patched version of the file in Django-nonrel.

Any ideas why is it there and can I actually remove it or fix it otherwise?

4 Answers

Django 1.6 uses base 64 encoding for the User's ID instead of base 36 encoding.

If you have any custom password reset URLs, you will need to update them by replacing uidb36 with uidb64 and the dash that follows that pattern with a slash. Also add "_", "\" and "-" to the list of characters that may match the uidb64 pattern.

For example this line in urls.py in Django 1.5-:

url(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
    'django.contrib.auth.views.password_reset_confirm',
    name='password_reset_confirm'),

Will need to be changed to this in Django 1.6+:

url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
    'django.contrib.auth.views.password_reset_confirm',
    name='password_reset_confirm'),

Here is the official changelog which details the change: https://docs.djangoproject.com/en/1.6/releases/1.6/#django-contrib-auth-password-reset-uses-base-64-encoding-of-user-pk

Related