title: Django - Cannot find URL "Using the URLconf defined in contactform.urls, Django tried these URL patterns, in this order"
body: <p>I am able to successfully compile my program, but when I go to the localhost address, it gives me an error. I have searched other forums about the same problem, but I couldn't find a solution for mine. Am I missing something here? I'm new to Django, so any is appreciated.</p>
  <pre><code>Using the URLconf defined in contactform.urls, Django tried these URL patterns, in this order:
  
  admin/
  
  showform
  
  The empty path didn’t match any of these.
  </code></pre>
  <p><strong>settings.py:</strong></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>INSTALLED_APPS = [
      'contact.apps.ContactConfig',
      '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 = 'contactform.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [],
          '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 = 'contactform.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'userInfo',
          'USER': 'root',
          'PASSWORD': 'password',
          'HOST': 'localhost',
          'PORT': '3306',
          'OPTIONS': {
              'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"
          }
      }
  }</code></pre>
  </div>
  </div>
  </p>
  <p><strong>apps.py</strong>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>from django.apps import AppConfig
  
  class ContactConfig(AppConfig):
      default_auto_field = 'django.db.models.BigAutoField'
      name = 'contact'</code></pre>
  </div>
  </div>
  </p>
  <p><strong>manage.py</strong>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>#!/usr/bin/env python
  """Django's command-line utility for administrative tasks."""
  import os
  import sys
  import pymysql
  pymysql.install_as_MySQLdb()
  
  
  def main():
      """Run administrative tasks."""
      os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'contactform.settings')
      try:
          from django.core.management import execute_from_command_line
      except ImportError as exc:
          raise ImportError(
              "Couldn't import Django. Are you sure it's installed and "
              "available on your PYTHONPATH environment variable? Did you "
              "forget to activate a virtual environment?"
          ) from exc
      execute_from_command_line(sys.argv)
  
  
  if __name__ == '__main__':
      main()</code></pre>
  </div>
  </div>
  </p>
  <p><strong>view.py</strong>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>from django.shortcuts import render
  
  # Create your views here.
  from django.shortcuts import render
  from .forms import FormContactForm
  
  
  def showform(request):
      form = FormContactForm(request.POST or None)
      if form.is_valid():
          form.save()
  
      context = {'form': form}
  
      return render(request, 'contactform.html', context)</code></pre>
  </div>
  </div>
  </p>
  <p><strong>urls.py</strong>
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>from django.contrib import admin
  from django.urls import path
  from contact import views
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('showform', views.showform),
  ]</code></pre>
  </div>
  </div>
  </p>