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

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

时间:2018-08-03 14:34:50      阅读:312      评论:0      收藏:0      [点我收藏+]

标签:site   ges   config   The   from   pytho   mod   perl   dex   

问题:

 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 '

标签:site   ges   config   The   from   pytho   mod   perl   dex   

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

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