#32349: unable to obtain auth template password_reset_done when using namespaced
urls
----------------------------------+---------------------------------------
     Reporter:  millerthegorilla  |                    Owner:  jhabarsingh
         Type:  Bug               |                   Status:  assigned
    Component:  Template system   |                  Version:  3.1
     Severity:  Normal            |               Resolution:
     Keywords:  password_reset    |             Triage Stage:  Unreviewed
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+---------------------------------------

Comment (by millerthegorilla):

 So, I eventually subclassed the password_reset:
    django_user_app/views.py
 {{{
 class UserPasswordResetView(PasswordResetView):
     html_email_template_name = 'registration/password_reset_email.html'
     success_url = reverse_lazy('django_users_app:password_reset_done')

     def __init__(self):
       super().__init__()
 }}}

 and used this line in my urls.py :
         path('password_reset/', UserPasswordResetView.as_view(),
 name='password_reset'),

 making sure to import the view at the top of urls.py.

 Also, I discovered that the reason emails were not being sent in the
 console was down to the fact that the user must be active or the email
 won't send.

 This leaves me with the conclusion that, in my opinion, the docs are not
 sufficiently clear.   When user_app is defined, a namespace is set.  But
 for a noob like myself, it is not at all clear that the user_app is a
 namespace....  surely it is an app_name?
 Also, this still doesn't solve why it is that all the password reset views
 are working, except for the password_done_view, particularly if you don't
 read django's source code, and see that the success_url needs to be
 overridden in a subclass.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32349#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.c67605371c69ea57980c664224d7a15f%40djangoproject.com.

Reply via email to