举例说明
#project1_urls.py
url(r'^$', views.indexView, name='index')
url(r'test', views.testView, name='test')
#project2_urls.py
url(r'', views.indexView, name='index')
url(r'test', views.indexView, name='index')
假设部署本地服务器:127.0.0.1:8080
对于project1,
浏览器输入127.0.0.1:8080,则导向index
浏览器输入127.0.0.1:8080/test,则导向test
浏览器输入127.0.0.1:8080/xxx,则报错
对于project2,
浏览器输入127.0.0.1:8080,则导向index
浏览器输入127.0.0.1:8080/test,则导向index
浏览器输入127.0.0.1:8080/xxx,则导向index
即所有的endpoint都会导向index
如上有误,欢迎指教,谢谢!