Just wondering where I can set the url to redirect to after logout. I know you can set the login url. I want to redirect to my home page.
Modern Django (2017+?) has a setting called LOGOUT_REDIRECT_URL.
LOGOUT_REDIRECT_URL
You don't need to overwrite or wrap anything.
According to the docs, you can just supply the next_page argument to the logout view. https://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.views.logout
next_page
(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/successfully_logged_out/'})
1.4m articles
1.4m replys
5 comments
57.0k users