title: Getting this error in django "ModuleNotFoundError at /myapp/"
body: <p>I am using django version 11.3. I create a separate HTML template file and import in my views.py file when i run this file it gives me an error. </p>
  
  <p><strong>ModuleNotFoundError at /myapp/</strong></p>
  
  <p><strong>No module named 'django.templates'</strong></p>
  
  <p>My settings.py file code:</p>
  
  <pre><code>TEMPLATES = [
  {
      'BACKEND': 'django.templates.backends.django.DjangoTemplates',
      'DIRS': [os.path.join(BASE_DIR, 'templates')]
      ,
      'APP_DIRS': True,
      'OPTIONS': {
          'context_processors': [
              'django.templates.context_processors.debug',
              'django.templates.context_processors.request',
              'django.contrib.auth.context_processors.auth',
              'django.contrib.messages.context_processors.messages',
          ],
      },
  },
  </code></pre>
  
  <p>]</p>
  
  <p>views.py file:</p>
  
  <pre><code>from django.http import HttpResponse
  from django .template import loader
  from .models import album
  
  def myapp(request):
    all_albums = album.objects.all()
    template = loader.get_template('myapp/index.html')
    context = {
     'all_albums': all_albums,
    }
    return HttpResponse(template.render(context, request))
  
   def detail(request, id):
      return HttpResponse("&lt;h1&gt;Your requested numbers is: " + str(id) +"&lt;h2&gt;")
  </code></pre>
  
  <p>html file:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
     &lt;meta charset="UTF-8"&gt;
     &lt;title&gt;This is list item&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;ul&gt;
      {% for a in all_albums %}
      &lt;li&gt;&lt;a href="/myapp/{{ a.id }}"&gt;{{ a.artist }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
  &lt;/ul&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Directory structure:</p>
  
  <pre><code>myapp &gt; templates &gt; myapp &gt; index.html
  </code></pre>