python session驗證用戶

res=redirect('/xinwen/index/')
         request.session['username']=user
         request.session['is_login']=True
		 
		 
		 
 if request.session['is_login']==True:
    user=request.session['username']
    return render(request,'index.html',{'current_user':user})
else:
    return HttpResponse('get out')
相關文章
相關標籤/搜索