Based
on this article I implemented a password reset function.
Unfortunately, currently this only works on the development server because the base URLs for the post_reset_redirect are different on the production server.
This is the relevant part of my urls.py, I marked the prolematic parts in
red:
url(r'^password/reset/$','django.contrib.auth.views.password_reset',{
'post_reset_redirect' : '/accounts/password/reset/done/', 'template_name': 'accounts/password_reset.html'}, name="password_reset"),\
(r'^password/reset/done/$','django.contrib.auth.views.password_reset_done',{'template_name': 'accounts/password_reset_done.html'}), \
(r'^password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$','django.contrib.auth.views.password_reset_confirm',
{'post_reset_redirect' : '/accounts/password/done/', 'template_name': 'accounts/password_reset_confirm.html'}),\
(r'^password/done/$', 'django.contrib.auth.views.password_reset_complete',{'template_name': 'accounts/password_reset_complete.html'}),
)
Normally I would use reverse('django.contrib.auth.views.password_reset_done') to get the correct URL, but using reverse() inside the urls.py leads to a configuration error, so how can I put the correct URLs here so it works correct both in development and production?
Thanks
Thomas