Django logout problem

后端 未结 5 1764
轻奢々
轻奢々 2021-02-09 08:05

Here is the problem I am facing with the Django Authenetication

  1. Access a page that requires a login.
  2. Logout (accessing django.contrib.auth.logout)
  3. <
5条回答
  •  爱一瞬间的悲伤
    2021-02-09 08:14

    Basically, this should work:

    from django.contrib.auth import logout
    
    def logout_view(request):
        logout(request)
        # Redirect to a success page.
    

    Could you clarify by posting your view if it's not something like this?

提交回复
热议问题