django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported.


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.

改成如下形式:

1 from django.contrib import admin
2 from django.urls import path
3 from django.conf.urls import url, include
4 
5 urlpatterns = [
6     path('admin/', admin.site.urls),
7     url(r'^app/', include('App.urls')),
8     url(r'^two/', include(('Two.urls', 'second'),namespace='second')),
9 ]

参考链接:https://blog.csdn.net/jason_cdd/article/details/106953974


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM