码迷,mamicode.com
首页 > 移动开发 > 详细

解决:Specifying a namespace in include() without providing an app_name和XXX is not a registered namespace问题

时间:2018-11-19 22:40:00      阅读:674      评论:0      收藏:0      [点我收藏+]

标签:prope   config   tps   ted   stack   included   instead   with   set   

python3 Django 环境下,如果你遇到namespace没有注册以及在根目录下urls.py中的include方法的第二个参数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.

解决方法:

请在[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和XXX is not a registered namespace问题

标签:prope   config   tps   ted   stack   included   instead   with   set   

原文地址:https://www.cnblogs.com/jerryspace/p/9986139.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!