首页 > 编程语言> > 使用url的时候添加app_name,提示错误:Specifying a namespace in include() without providing an app_name ' dj
使用url的时候添加app_name,提示错误:Specifying a namespace in include() without providing an app_name ' dj
作者:互联网
在使用url的时候,有些地方是这样写的:
url(r'^blog/', include('blog.urls', namespace='blog',app_name='blog'))
但是会报错:
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
只需要换种写法即可:
url(r'^blog/', include(('blog.urls', 'blog'), namespace='blog'))
标签:name,app,namespace,blog,Specifying,include 来源: https://www.cnblogs.com/mmykdbc/p/13594104.html