Suggestion, to remove unnecessary if: else: statements, can we have a config setting of - say - 'on-logout-redirect-url-name', which can then have a reverse() on that setting.

Same with on-login-redirect-url-name