You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/paas/django/how-tos/use-asgi.mdx
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,22 @@ ASGI یا Asynchronous Server Gateway Interface در Django یک استاندا
42
42
{`ASGI_APPLICATION = 'myapp.asgi.application'`}
43
43
</Highlight>
44
44
</div>
45
+
<divclassName="h-2" />
46
+
47
+
همچنین، به دلیل استفاده از ASGI، ماژولها به شکل async بارگذاری میشوند. بنابراین قبل از اجرا شدن برنامه، باید از بارگذاری درست ماژولها، اطمینان حاصل کنید.
48
+
برای اینکار، بایستی قطعه کد زیر را در ابتدای فایل <Important>asgi.py</Important> قرار دهید:
همچنین، به دلیل استفاده از ASGI، ماژولها به شکل async بارگذاری میشوند. بنابراین قبل از اجرا شدن برنامه، باید از بارگذاری درست ماژولها، اطمینان حاصل کنید.
342
+
برای اینکار، بایستی قطعه کد زیر را در ابتدای فایل <Important>asgi.py</Important> قرار دهید:
<Sectionid="deploy-websocket-django"title="استقرار برنامه Django WebSocket در لیارا" />
405
410
406
411
برای استقرار برنامههای وبسوکت جنگو در لیارا، نیازی به انجام تغییر خاصی نیست. صرفاً باید به جای استفاده از آدرس <Important>ws</Important>، عبارت <Important>wss</Important> را به کار ببرید تا اتصال، ایمن و سازگار باشد. همچنین، در فایل <Important>settings.py</Important> باید قطعه کد زیر را حذف کنید:
0 commit comments