title: Django: Getting 404 Error After Adding Views, Models and URLs Correctly
body: <p>I am a beginner in Django. Right now, I am doing a simple app, called GameReview. It will allow the users to add the reviews of their favorite games. Right now, I am facing a 404 error.
  It looks like this:</p>
  
  <pre><code>Page not found (404)
  Request Method: GET
  Request URL:    http://127.0.0.1:8000/gamereview/
  Using the URLconf defined in gamerevs.urls, Django tried these URL patterns, in this order:
  
  admin/
  [name='hw']
  gamereview [name='gamelist']
  The current path, gamereview/, didn't match any of these.
  </code></pre>
  
  <p>Here are my codes of <strong>models.py</strong> inside gamereview folder:</p>
  
  <pre><code>from django.db import models
  from django.template.defaultfilters import slugify
  
  # Create your models here.
  class Tag(models.Model):
      label = models.CharField(max_length=20)
  
      def __str__(self):
          return self.label
  
  class Game(models.Model):
      title = models.CharField(max_length=100)
      developer = models.CharField(max_length=100)
      platform = models.CharField(max_length=50, default='null')
      label_tag = models.ManyToManyField(Tag)
      slug = models.SlugField(max_length=150, default='null')
  
      def __str__(self):
          return self.title
  
      def save(self, *args, **kwargs):
          self.slug = slugify(self.title)
          super().save(*args, **kwargs)
  
  class Review(models.Model):
      game = models.ForeignKey(Game, on_delete=models.CASCADE)
      review = models.CharField(max_length=1000)
      date = models.DateField(auto_now=True)
      slug = models.SlugField(max_length=150, default='null')
  
      def __str__(self):
          return self.review
  
      def save(self):
          super(Review, self).save()
          self.slug = '%i-%s' % (
              self.id, slugify(self.game.title)
          )
          super(Review, self).save()
  </code></pre>
  
  <p>Here are my codes of <strong>urls.py</strong> inside gamereview folder:</p>
  
  <pre><code>from . import views
  from django.urls import path
  
  urlpatterns = [
      path('gamereview', views.gamelist, name='gamelist'),
  ]
  </code></pre>
  
  <p>Here are my codes of <strong>views.py</strong> inside gamereview folder:</p>
  
  <pre><code>from django.shortcuts import render
  
  def gamelist(request):
      context_dict = {'via': "Using template"}
      return render(request, 'gamereview/gamelist.html', context_dict)
  </code></pre>
  
  <p>Here are the codes of <strong>settings.py</strong> in gamerevs folder:</p>
  
  <pre><code>"""
  Django settings for gamerevs project.
  
  Generated by 'django-admin startproject' using Django 2.2.7.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/2.2/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/2.2/ref/settings/
  """
  
  import os
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = 'su9+iji4y-5+ddebbavou+166_p2ph1n2cls3a^x_n9o6yl1nq'
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'gamereview.apps.GamereviewConfig',
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'gamerevs.urls'
  TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': ['/gamerevs/', TEMPLATE_PATH],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'gamerevs.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  
  # Password validation
  # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
      },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/2.2/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/2.2/howto/static-files/
  
  STATIC_PATH = os.path.join(BASE_DIR, 'static')
  STATIC_URL = '/static/'
  
  STATIC_URL = '/static/'
  STATICFILES_DIRS = [
      STATIC_PATH,
  ]
  </code></pre>
  
  <p>Here are my codes of <strong>urls.py</strong> under gamerevs folder:</p>
  
  <pre><code>from django.contrib import admin
  from django.urls import include, path
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('', include('helloworld.urls')),
      path('', include('gamereview.urls')),
  
  ]
  </code></pre>
  
  <p>Here are my codes of <strong>gamelist.html</strong> located inside <strong>gamereview</strong> folder of the <strong>templates</strong> folder.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Gamelist&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;This is Game List Page&lt;/h1&gt;
      &lt;strong&gt;{{ via }}&lt;/strong&gt;&lt;br /&gt;
      &lt;img src="{% static "images/Super_Mario_Odyssey.jpg" %}" alt="Super Mario Odyssey" /&gt; &lt;!-- New line --&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I thought that logging into Django admin and adding new games and reviews from there would fix the issue. However, after doing it, I am still getting the 404 error. </p>