Telegram Group & Telegram Channel
یه نکته در مورد include در urls.py

عکس رو ببینید. من برای path ها namespace تعریف کردم.

✔️متد include میگه اگه namespace تعریف کنی، باید برای app ت هم app_name تعریف کنی.

وگرنه خطای زیر رو میده:

 Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.


برای حل این مشکل
(مثلا فرض کن میخوای name برای path یی داشته باشی که توی urls.py اصلی پروژه اس)

اینجوری باید path رو اوکی کنی:

path("felan-url/", include(("felan_app", "felan_name"))),


دقت کن. یه tuple برای include فرستادم.

اینجوری دیگه توی تمپلت می تونم با app_name ع felan_name به اسم path های اون اپ دسترسی داشته باشم (به شرطی که name داشته باشن).

پیچیده گفتم؟ برو کد include رو بخون، متوجه منظورم میشی.



tg-me.com/djangolearn_ir/992
Create:
Last Update:

یه نکته در مورد include در urls.py

عکس رو ببینید. من برای path ها namespace تعریف کردم.

✔️متد include میگه اگه namespace تعریف کنی، باید برای app ت هم app_name تعریف کنی.

وگرنه خطای زیر رو میده:

 Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.


برای حل این مشکل
(مثلا فرض کن میخوای name برای path یی داشته باشی که توی urls.py اصلی پروژه اس)

اینجوری باید path رو اوکی کنی:

path("felan-url/", include(("felan_app", "felan_name"))),


دقت کن. یه tuple برای include فرستادم.

اینجوری دیگه توی تمپلت می تونم با app_name ع felan_name به اسم path های اون اپ دسترسی داشته باشم (به شرطی که name داشته باشن).

پیچیده گفتم؟ برو کد include رو بخون، متوجه منظورم میشی.

BY جنگولرن




Share with your friend now:
tg-me.com/djangolearn_ir/992

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Telegram Be The Next Best SPAC

I have no inside knowledge of a potential stock listing of the popular anti-Whatsapp messaging app, Telegram. But I know this much, judging by most people I talk to, especially crypto investors, if Telegram ever went public, people would gobble it up. I know I would. I’m waiting for it. So is Sergei Sergienko, who claims he owns $800,000 of Telegram’s pre-initial coin offering (ICO) tokens. “If Telegram does a SPAC IPO, there would be demand for this issue. It would probably outstrip the interest we saw during the ICO. Why? Because as of right now Telegram looks like a liberal application that can accept anyone - right after WhatsApp and others have turn on the censorship,” he says.

telegram from jp


Telegram جنگولرن
FROM USA