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 16, 2020 in Python by kartik
• 37,490 points
281 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 16, 2020 by Niroj
• 82,580 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
150 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
1,322 views
0 votes
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,580 points
619 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,580 points
257 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 2, 2020 in Python by Niroj
• 82,580 points
2,242 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,580 points
2,055 views