Devinwon / article

0 stars 0 forks source link

Django2.0——logout #14

Open Devinwon opened 6 years ago

Devinwon commented 6 years ago
def logout(request):
        context={}
        try:
            response=redirect(to='/account/login')
                        #delete cookie
            response.delete_cookie('username')
            return response
        except:
            return render(request,'index.html',context)