You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
齐老师,您好,在django2.0中,展示个人信息这个章节中的myself()方法,用get()会一直报错提示书中的那个错误,换成filter()方法,代码可正常运行,
@login_required(login_url='/account/login/')
def myself(request):
user = User.objects.filter(username=request.user.username)
userprofile = UserProfile.objects.filter(user=user)
userinfo = UserInfo.objects.filter(user=user)
return render(request, 'account/myself.html', {'user': user, "userinfo":
userinfo, "userprofile": userprofile})
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#8>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ADel66kzMqIwGM1M0EdkgZD8AW71IW0Mks5uzexLgaJpZM4Y2sIo>
.
齐老师,您好,在django2.0中,展示个人信息这个章节中,按书中的例子输入代码,用get()会一直提示书中的那个错误,在网上百度了也没有找到解决方法以,求老师指点
The text was updated successfully, but these errors were encountered: