How to configure where to redirect after a log out in Django

0 votes

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.

Aug 17, 2020 in Python by kartik
• 37,520 points
3,903 views

1 answer to this question.

0 votes

Hello @kartik,

You don't need to overwrite or wrap anything.

You can just supply the next_page argument to the logout view.

(r'^logout/$', 'django.contrib.auth.views.logout',
{'next_page': '/successfully_logged_out/'})

Hope it helps!!
Thank you!!

answered Aug 17, 2020 by Niroj
• 82,840 points

Related Questions In Python

0 votes
1 answer

How to hide a window in the constructor immediately after creation?

You can use QtCore.QTimer class Example(QWidget):     def __init__(self, app):         QWidget.__init__(self)         QTimer.singleShot(0, ...READ MORE

answered Apr 17, 2018 in Python by anonymous
927 views
–1 vote
2 answers
0 votes
1 answer

How to eliminate out outliers in a dataframe?

There are various ways we can replace ...READ MORE

answered Jul 16, 2019 in Python by Dinesh
2,151 views
–1 vote
2 answers
0 votes
1 answer

How to temporarily disable a foreign key constraint in MySQL?

Hello @kartik, To turn off foreign key constraint ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,840 points
2,494 views
0 votes
1 answer

How do I use Django templates without the rest of Django?

Hello @kartik, Let's say you have this important ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,840 points
1,577 views
0 votes
1 answer

How to update date automatically after a value change in django?

Hello @kartik, Only change your pub_date if published has ...READ MORE

answered Jul 3, 2020 in Python by Niroj
• 82,840 points
9,710 views
0 votes
1 answer

How to load a custom JS file in Django admin home?

Hello @kartik, You can override templates/admin/index.html and add the JavaScript ...READ MORE

answered May 14, 2020 in Python by Niroj
• 82,840 points
7,994 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP