由于name没有作用域,Django在反解URL时,会在项目全局顺序搜索,当查找到第一个name指定URL时,立即返回. project/urls.py urlpatterns = [ path('admin/', admin.site.urls), path('app/', include('app.urls')), path('app2/', include('app2.urls')), path('app3/', include('app3.urls')), ] app/urls.py u…