Notice: file_put_contents(): Write of 248 bytes failed with errno=28 No space left on device in /var/www/tgoop/post.php on line 50

Warning: file_put_contents(): Only 16384 of 16632 bytes written, possibly out of free disk space in /var/www/tgoop/post.php on line 50
جنگولرن@djangolearn_ir P.614
DJANGOLEARN_IR Telegram 614
آشنایی با کلاس TemplateResponse در جنگو

توی ویوهای فانکشن بیس جنگو معمولا متد render رو return می کنیم که توی مسیر django.shortcuts هست.

✔️گاهی اوقات لازم میشه response ایی که بر میگردونیم یکم مخلفات داشته باشه. مثلا به http header ش یه چیزی (به هر دلیلی) اضافه کنیم. در این مواقع میتونیم TemplateResponse رو return کنیم.
✔️وقتی هم که Middleware سفارشی ایی داشته باشیم که تغییراتی رو توی response اعمال میکنه (ریسپانسی که template داره) ، استفاده از TemplateResponse خوبه.

اگه داکیومنت جنگو و بخش میدلورهارو خونده باشی متدی به اسم process_template_response هست.
✔️متد process_template_response در Middleware ها فقط بر روی پاسخ‌هایی از نوع TemplateResponse اجرا می‌شه.
👍7



tgoop.com/djangolearn_ir/614
Create:
Last Update:

آشنایی با کلاس TemplateResponse در جنگو

توی ویوهای فانکشن بیس جنگو معمولا متد render رو return می کنیم که توی مسیر django.shortcuts هست.

✔️گاهی اوقات لازم میشه response ایی که بر میگردونیم یکم مخلفات داشته باشه. مثلا به http header ش یه چیزی (به هر دلیلی) اضافه کنیم. در این مواقع میتونیم TemplateResponse رو return کنیم.
✔️وقتی هم که Middleware سفارشی ایی داشته باشیم که تغییراتی رو توی response اعمال میکنه (ریسپانسی که template داره) ، استفاده از TemplateResponse خوبه.

اگه داکیومنت جنگو و بخش میدلورهارو خونده باشی متدی به اسم process_template_response هست.
✔️متد process_template_response در Middleware ها فقط بر روی پاسخ‌هایی از نوع TemplateResponse اجرا می‌شه.

BY جنگولرن




Share with your friend now:
tgoop.com/djangolearn_ir/614

View MORE
Open in Telegram


Telegram News

Date: |

2How to set up a Telegram channel? (A step-by-step tutorial) Other crimes that the SUCK Channel incited under Ng’s watch included using corrosive chemicals to make explosives and causing grievous bodily harm with intent. The court also found Ng responsible for calling on people to assist protesters who clashed violently with police at several universities in November 2019. But a Telegram statement also said: "Any requests related to political censorship or limiting human rights such as the rights to free speech or assembly are not and will not be considered." Earlier, crypto enthusiasts had created a self-described “meme app” dubbed “gm” app wherein users would greet each other with “gm” or “good morning” messages. However, in September 2021, the gm app was down after a hacker reportedly gained access to the user data. "Doxxing content is forbidden on Telegram and our moderators routinely remove such content from around the world," said a spokesman for the messaging app, Remi Vaughn.
from us


Telegram جنگولرن
FROM American