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: |

If riding a bucking bronco is your idea of fun, you’re going to love what the stock market has in store. Consider this past week’s ride a preview.The week’s action didn’t look like much, if you didn’t know better. The Dow Jones Industrial Average rose 213.12 points or 0.6%, while the S&P 500 advanced 0.5%, and the Nasdaq Composite ended little changed.

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

telegram from us


Telegram جنگولرن
FROM USA