gpt4 book ai didi

python - Django HttpRequest 与请求

转载 作者:行者123 更新时间:2023-11-28 20:32:36 26 4
gpt4 key购买 nike

我是 Django 的新手。奇怪地注意到每个“ View ”函数都有一个 request 作为第一个参数,但是当我在文档中查找 request 对象时,我得到了 HttpRequest 而不是...

它们是一样的吗?

如果是这样,为什么还要为同一个对象指定两个名称呢?

最佳答案

Are they the same? If so, why bother to give two names for the same object?

HttpRequest 是一个类,views 的 request 参数是这个类的一个实例(好吧,至少应该是这样)。

关于python - Django HttpRequest 与请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52258156/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com