mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Fixed #12405 -- Added LOGOUT_REDIRECT_URL setting.
After a user logs out via auth.views.logout(), they're redirected to LOGOUT_REDIRECT_URL if no `next_page` argument is provided.
This commit is contained in:
committed by
Tim Graham
parent
ad216381fc
commit
dcee1dfc79
@@ -489,6 +489,8 @@ LOGIN_URL = '/accounts/login/'
|
||||
|
||||
LOGIN_REDIRECT_URL = '/accounts/profile/'
|
||||
|
||||
LOGOUT_REDIRECT_URL = None
|
||||
|
||||
# The number of days a password reset link is valid for
|
||||
PASSWORD_RESET_TIMEOUT_DAYS = 3
|
||||
|
||||
|
||||
@@ -104,6 +104,8 @@ def logout(request, next_page=None,
|
||||
|
||||
if next_page is not None:
|
||||
next_page = resolve_url(next_page)
|
||||
elif settings.LOGOUT_REDIRECT_URL:
|
||||
next_page = resolve_url(settings.LOGOUT_REDIRECT_URL)
|
||||
|
||||
if (redirect_field_name in request.POST or
|
||||
redirect_field_name in request.GET):
|
||||
|
||||
Reference in New Issue
Block a user