We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version : Django==1.11.29
原文描述:
执行完上述方法, 并且Django帮我们执行完view, 拿到最终的 response 后, 如果使用了模板的 response (这里指通过 return render(request, 'index.html', context={}) 方式返回的 response), 就会来到这个方法中.
实际测试后发现:
def index(request): students = Student.get_all() form = StudentForm() context = { "students": students, "form": form, } return render(request, 'index.html', context=context) # return TemplateResponse(request, "index.html", context=context)
process_response
return TemplateResponse(request, "index.html", context=context)
return render(request, 'index.html', context=context)
process_template_response
这是我的发现, 欢迎大家指出我过程中是否存在问题导致和 书籍 中 描述的结论不符.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
version : Django==1.11.29
原文描述:
实际测试后发现:
process_response
方法;return TemplateResponse(request, "index.html", context=context)
而非return render(request, 'index.html', context=context)
才会进入process_template_response
方法中这是我的发现, 欢迎大家指出我过程中是否存在问题导致和 书籍 中 描述的结论不符.
The text was updated successfully, but these errors were encountered: