title: How can I view my HTML page in Python using Django
body: <p>I'm new into creating projects in Python using Django.</p>
  
  <p>I'm creating a website in Python using the Django framework.
  I've created an "<strong>index</strong>" function in the "<strong>views.py</strong>" file to render the "<strong>index.html</strong>" file present in the "<strong>templates</strong>" folder.
  Below is the code for the "<strong>views.py</strong>" file.</p>
  
  <pre><code>from django.http import HttpResponse
  from django.shortcuts import render
  
  
  # Create your views here.
  def index(request):
      return render(request,"index.html",{})
  </code></pre>
  
  <p>I've also added the navigation for the "<strong>index</strong>" page.
  Below is the code for "<strong>urls.py</strong>" file.</p>
  
  <pre><code>from django.contrib import admin
  from django.urls import path
  
  from gallery import views
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('index/', views.index,name="index")
  ]
  </code></pre>
  
  <p>Below is the code of templates section in <strong>settings.py</strong> file.</p>
  
  <pre><code>TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR,'templates'),], #path to templates folder in local system.
          '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',
              ],
          },
      },
  ]
  </code></pre>
  
  <p>But when I try to open the "<strong>index</strong>" page URL, I'm not able to view the page.</p>
  
  <p><strong>Error screenshot for reference</strong></p>
  
  <p><a href="https://i.stack.imgur.com/FV2uf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FV2uf.png" alt="enter image description here"></a></p>
  
  <p><strong>Folder structure for reference:-</strong></p>
  
  <pre><code>Gallery_Website
  |--gallery
    |_ __init__.py
    |_ admin.py
    |_ apps.py
    |_ models.py
    |_ tests.py
    |_ views.py
  |--Gallery_Website
    |_ __init__.py
    |_ settings.py
    |_ urls.py
    |_ wsgi.py
  |--templates
    |_ index.html
  |--db.sqlite3
  |--manage.py
  </code></pre>
  
  <p>What could be wrong while defining the navigation for the "index" page?</p>
  
  <p>Let me know if any other information is required.</p>