title: Django Include() in urls.py with two apps
body: <p>I believe this is a simple question but I am having a hard time figuring out why this is not working.</p>
  
  <p>I have a django project and I've added a second app (sales).  Prior to the second app, my urls.py simply routed everything to the first app (chart) with the following:</p>
  
  <pre><code>urlpatterns = [
  
      path('admin/', admin.site.urls),
      path('', include('chart.urls')),
  ]
  </code></pre>
  
  <p>and it worked fine.</p>
  
  <p>I have read the docs over and over a looked at many tutorials, so my impression is that I can simply amend the urls.py to include:</p>
  
  <pre><code>urlpatterns = [
  
      path('admin/', admin.site.urls),
      path('sales/', include('sales.urls')),
      path('', include('chart.urls')),
  ]
  </code></pre>
  
  <p>and it should first look for a url with sales/ and if it finds that then it should route it to sales.urls, and if it doesn't find that then move on and route it to chart.urls.  However, when I load this and type in 127.0.0.1:8000/sales, it returns the following error:</p>
  
  <pre><code>Page not found (404)
  Request Method: GET
  Request URL:    http://127.0.0.1:8000/sales/
  Raised by:  chart.views.index
  </code></pre>
  
  <p>which tells me that it is not routing my sales/ url to sales.urls but to chart.urls.  When I change <code>path('', include('chart.urls'))</code>, to <code>path('', include('sales.urls'))</code>, it does route it to sales.urls so I know that my sales.urls file is set up correctly.</p>
  
  <p>I know this is probably an easy question but I cannot figure it out with anything I've read.  Any help is appreciated.</p>
  
  <p>chart.urls:</p>
  
  <pre><code>from django.urls import path, re_path
  from . import views
  
  urlpatterns = [
      path('dashboard/', views.chart, name='dashboard'),
      path('', views.index, name='index', kwargs={'pagename': ''}),
      path('&lt;str:pagename&gt;/', views.index, name='index'),
  ]
  </code></pre>
  
  <p>sales.urls:</p>
  
  <pre><code>from django.urls import path
  from . import views
  
  urlpatterns = [
      path('sales/', views.sales, name='Sales Dashboard'),
  ]
  </code></pre>