我的代码:
@login_required() def Cb(request): if "请先登陆" in request.GET: return HttpResponseRedirect("http://www.123456.com") else: User=request.user.username return render_to_response('123.html',{'User':User,})`
这样写页面报错,求助大家了~
别的不说,语句的写法不对。 if......: ...... else: ...... 缩进在python中是很重要的,一般是4个空格
报什么错》