The configuration of the official document (settings.py) contains everything you can set on https://django-allauth.readthedocs.io/en/latest/configuration.html, for example, the ACCOUNT_LOGOUT_REDIRECT_URL, but it didn't seem to have the desired settings (just look).
Then...
defined in venv\Lib\site-packages\allauth\account\views.pyclass PasswordChangeView (AjaxCapableProcessFormViewMixin, FormView):
template_name = "account/password_change." + app_settings.TEMPLATE_EXTENSION
form_class = ChangePasswordForm
success_url = reverse_lazy("account_change_password")
If you create a class that inherits this PasswordChangeView and overwrite success_url, you can do it. (Note:) Overwrite the following routing to accounts\urls.py as well
path("password/change/", views. Your view function, name="account_change_password"),
Incidentally, if you look at the default behavior, when the password change was successful, the same form was displayed in GET and the flash message "Password changed" was displayed (this action is described in the form_valid method of the class above).
Also, if you failed, for example, if you entered the wrong current password, the form error message "Please enter your current password" appeared on the form.404 is strange.Please try to find the relevant corrections.I'm sorry that this is not a complete answer.
© 2024 OneMinuteCode. All rights reserved.