Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect the user back to the login page after logout in django/allauth?

I installed a very basic project on django with the allauth module. It works well...except that i have a 404 page when i try to logout using http://localhost:8000/accounts/logout/.

The urls.py

urlpatterns = [ url(r'^accounts/', include('allauth.urls')), url(r'^aboutus/$', TemplateView.as_view(template_name="aboutus.html"), name="aboutus"), url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)),
]

and in settings.py i set ACCOUNT_LOGOUT_ON_GET= True to avoid the logout confirmation.

My goal is to set path: login page-->aboutus:click on logout button--> login page.

I read on internet a lot of stuff but it still does not work.

Please help

like image 371
alvaro562003 Avatar asked Dec 09 '22 00:12

alvaro562003


1 Answers

solution in the setting file : ACCOUNT_LOGOUT_REDIRECT_URL ="/accounts/login"

like image 81
alvaro562003 Avatar answered Apr 06 '23 14:04

alvaro562003