title: How to fix "Page not found (404)" error ("Django tried these URL patterns... The empty path didn't match any of these.")
body: <p>As a newbie to Django, I encountered the same problem as many before me. I would appreciate if you didn't mark my question as a double immediately because I checked the fixes those old posts suggested but to no avail. </p>
  
  <p>I was following <a href="https://realpython.com/get-started-with-django-1/#projects-app-views" rel="nofollow noreferrer">this</a> tutorial and have finished with all up to the heading "Projects App: Templates". Now when I start the server, at <a href="http://localhost:8000/" rel="nofollow noreferrer">http://localhost:8000/</a> I get:</p>
  
  <blockquote>
    <p>Page not found (404)
    Request Method:   GET
    Request URL:  <a href="http://localhost:8000/" rel="nofollow noreferrer">http://localhost:8000/</a></p>
    
    <p>Using the URLconf defined in personal_portfolio.urls, Django tried these URL patterns, in this order:</p>
  
  <pre><code>admin/
  projects/
  </code></pre>
    
    <p>The empty path didn't match any of these.</p>
    
    <p>You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.</p>
  </blockquote>
  
  <p>This is console output when I run server: </p>
  
  <blockquote>
    <p>System check identified no issues (0 silenced).</p>
    
    <p>April 05, 2019 - 15:31:54</p>
    
    <p>Django version 2.2, using settings 'personal_portfolio.settings'</p>
    
    <p>Starting development server at <a href="http://127.0.0.1:8000/" rel="nofollow noreferrer">http://127.0.0.1:8000/</a></p>
    
    <p>Quit the server with CTRL-BREAK.</p>
    
    <p>Not Found: /</p>
    
    <p>[05/Apr/2019 15:32:01] "GET / HTTP/1.1" 404 2042</p>
    
    <p>Not Found: /favicon.ico</p>
    
    <p>[05/Apr/2019 15:32:01] "GET /favicon.ico HTTP/1.1" 404 2093</p>
  </blockquote>
  
  <p>What I tried, but didn't help: </p>
  
  <ol>
  <li>restarting the server,</li>
  <li>checking my code inside the files against the tutorial's <a href="https://github.com/realpython/materials/tree/d49c624500e4470107bb258642d2744eeeeefc5a/rp-portfolio" rel="nofollow noreferrer">source code</a>,</li>
  <li>Made sure that <code>'projects'</code> is inside the <code>INSTALLED_APPS</code> list in <code>settings.py</code>. </li>
  </ol>
  
  <p>Here is <code>urls.py</code> that's inside rp-portfolio\personal_portfolio: </p>
  
  <pre><code>from django.contrib import admin
  from django.urls import path, include
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('projects/', include('projects.urls'))
  ]
  </code></pre>
  
  <p>Here is <code>urls.py</code> that's inside rp-portfolio\projects: </p>
  
  <pre><code>from django.urls import path
  from . import views
  
  urlpatterns = [
      path("", views.project_index, name="project_index"),
      path("&lt;int:pk&gt;/", views.project_detail, name="project_detail"),
  ]
  </code></pre>