本文介绍了django中的哪个函数创建一个HttpRequest实例,并交给视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解django的内疚,我不会得到任何好的教程。

Am try to understand the guts of django, and i cant get any good tutorial on this.

我知道django视图在调用时接收到一个HttpRequest实例作为参数之一,我想知道什么是django内部函数在哪里接收到浏览器,创建HttpRequest实例并将其交给正确的视图?

I know django views receive a HttpRequest instance as one of the arguments when they are called, what i would like to know is what function in django internals receive the request from the browser, creates the HttpRequest instance and hands it over to the right view?

希望清楚!

Gath

推荐答案

>>> from django.http import HttpRequest
>>> HttpRequest()
<HttpRequest
GET:{},
POST:{},
COOKIES:{},
META:{}>

如果您需要这个来测试和模拟请求,那没关系,但是如果您尝试使用相互呼吁观点,效率不高。

If you need this for testing and emulating requests, that's fine, but if you try to use this to call views from one another, it's inefficient.

这篇关于django中的哪个函数创建一个HttpRequest实例,并交给视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 12:19