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')