django 内置验证登录模块(auth login logout authenticate)测试
index页加装饰器@login_required需要登陆才能查看user=authenticate(username=username,password=password)返回user对象若返回user对象,登陆login(request,user),之后可以访问indexviews.pyfromdjango.contrib.auth.decoratorsimportlogin_required