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