Categories: djangopython

解决django运行时报错Specifying a namespace in include()

python3 Django2.0 环境下,如果你遇到namespace没有注册以及在根目录下urls.py中的include方法的第二个参数namespace添加之后就出错的问题。请在[app_name]目录下的urls.py中的urlpatterns前面加上app_name=’app_name’, app_name代表你的应用的名称。可以参考这篇:https://stackoverflow.com/questions/14892462/django-error-upolls-is-not-a-registered-namespace

Specifying a namespace in include() without providing an app_name ‘

django.core.exceptions.ImproperlyConfigured: 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.

 

 

Kai

Share
Published by
Kai
Tags: django

Recent Posts

只有美区才可以升级到McAfee+Adv

 注意是升级到而不是直接购买 …

1 天 ago

美区en-us LiveSafe升级到McAfee+Adv

     有些小众McAfee…

1 天 ago

注册美区McAfee方法——堪比Affid=0!

 卡饭论坛上,有网友指出,Af…

1 周 ago

国区和美区McAfee的区别

 在卡饭论坛,有网友发现,国区…

1 周 ago

SQL评估期已过

 早上开发同事过来说数据库连不…

2 周 ago

【下一代存储】玻璃光盘

 据长江日报昨日消息,武汉光电…

2 周 ago