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

问题:

 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 '

上一篇:sql server远程访问Oracle数据库


下一篇:Android更改popupmenu背景并显示图标