在“next.html”页面登录时如何向任何用户显示他/她的用户名???
def signin(request):
if request.method != 'POST':
return render(request, 'login.html', {'error': 'Email or Password is incorrect'})
user_profile = User_account.objects.filter(e_mail = request.POST['user_email'], passwd = request.POST['password'])
if user_profile:
return render(request, 'next.html', {'name' :User_account.objects.**WHAT SHOULD I WRITE HERE???** } )
else:
return render(request, 'login.html', {'error': 'Email or Password is incorrect'})