首页 > 移动平台 > 详细

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

时间:2018-08-03 13:03:55      阅读:175      评论:0      收藏:0      [点我收藏+]

问题:

 File "D:\Python34\lib\site-packages\django\urls\conf.py", line 39, in include
    ‘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 t
he included module, or pass a 2-tuple containing the list of patterns and app_na
me instead.

  

处理方法:

解决方法,在mysite/urls.py增加app_name=‘mysite

 

‘‘‘定义mysite的url模式‘‘‘
from django.conf.urls import url
from . import views

app_name=‘mysite‘

urlpatterns={
    #主页
    url(r‘^$‘,views.index,name=‘index‘)
}

 

  

 


 

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

原文:https://www.cnblogs.com/chenliwei/p/9413244.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!