Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logout message using django-allauth and redirect to home page

I'm using allauth for authentication and django messages work really well throughout all signup, login etc stages.

However, to avoid the 2 step 'are you sure you want to logout?' I have overidden the allauth view as so:

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

This technique works fine, and the user is redirected to the home page immediately after clicking 'logout.'

However, with this approach I'm no longer able to display a successfully logged out message.

Could anyone give me a tip on how to do this using the messages framework and my current setup?

Thanks in advance,

like image 679
rix Avatar asked Oct 16 '25 13:10

rix


1 Answers

The simple answer to this is to simply set:

ACCOUNT_LOGOUT_ON_GET to True

The extra url to override accounts/logout isn't necessary..

like image 81
rix Avatar answered Oct 19 '25 06:10

rix