Z
Z
zelsky2015-05-20 21:20:47
Django
zelsky, 2015-05-20 21:20:47

Redirect after logout django?

I use django allauth , I need to either change the page after the log out or redirect to the main page.
http://127.0.0.1:8000/accounts/logout/

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zigen, 2015-05-22
@zigen

def logout_view(request):
    logout(request)
    return HttpResponseRedirect('your path')

I
ibooj, 2016-02-06
@ibooj

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

E
Evgeny Maltsev, 2015-05-20
@hellpirat

if user.is_active:
    login(request, user)
    return redirect('/')
else:
    return redirect('/куда-надо')

Something like that, probably. Not sure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question