Похожие чаты

Render is used to for what the name already indicate:

to render a template file (mostly html, but could be any format). render is basically a simple wrapper around a HttpResponse which renders a template, though as said in the previous answer you can use HttpResponse to return others things as well in the response, not just rendering templates.
https://stackoverflow.com/questions/7301985/httpresponse-vs-render?lq=1 which is i cant fully understand,, all i know that HttpResponse to render the HTML hard coded in the app views.py https://www.tutorialspoint.com/django/django_creating_views.htm

2 ответов

10 просмотров

HttpResponse does what it says. It outputs a response to a request. That response can be in the form of a rendered template, a status code, or hardcoded html.

You're already half way there. HttpResponse is an object that represents HTTP response https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html while render is function that wraps it for specific purpose (rendering html). If you want more customized response (binary, xml, json .etc) with certain headers, you can directly modify HttpResponse

Похожие вопросы

Обсуждают сегодня

Типа вызывать GetParent и проверять на соответствие GetModuleHandle?
The Bird of Hermes
67
Do any of you guys have interesting projects one could join? I'm a Middle Full-Stack developer (JS/TS, React & Node)
Lev Shapiro
40
I read yesterday that in the near future most cryptos will be gone. It's like there is a lot of bullshit within the crypto sphere and this corruption some way is going to be c...
Kanah The Great
48
$res = json_decode($наша строка из респонса); $res1 = array_map(fn($o) => $o->name, $res->breadcrumbs[0]->entities); Как такое будет на Хаскеле?.. В начале весь джейсон, в ко...
Хаскель Моисеевич Гопник
27
Hello, I have a question. Can anyone help me? I want to make my cryptocurrencies, like Tron, untraceable by anyone, even government organizations. I was told that to do this,...
 ➛ Eᒪᕼᗩᗰ
14
В чем сила брат, в NASM или FASM?
Isaac Kleiner
18
Вопрос по диагностике ошибок (я знаю в чем, в данном конкретном примере, я знаю, как исправить, пример модельный, понятно, что в реальности бывает намного запутаннее). module...
ⰄⰎⰋⰐⰐⰑⰛⰤⰧⰧⰩⰄ ⰊⰑⰁⰓⰡⰛⰦⰕⰫ
11
I guess you did too?
OJohnny
13
Nice, where you from?
Terry Chester
10
А чем вам питонисты не угодили?😂
.
79
Карта сайта