Django password_change_done viewable only on redirect from password_change view (on succesful password change)
Probably the best way to do that is to use the session:
When the password_change view is valid and before redirecting to the password_change_done view, just set a password_changed session attribute to True, something like this:
request.session['password_changed'] = True
After that, in your password_change_done view, check if password_changed is True and only then actually display the view, something like:

if request.session.get('password_changed'):
    # render password_change_done view
else:
    # redirect to the password_change view
I require the password_change_done url to be visible only when the password_change view redirects to it (on successful change of password). Otherwise on going to the password_change_done view, it must redirect to the password_change view
How can this be done?