title: Django: TemplateDoesNotExist at /accounts/login/
body: <p>I'm following this <a href="https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication" rel="noreferrer">tutorial</a> from Mozilla.org, </p>
  
  <p><strong><em>Setting up your authentication views</em></strong></p>
  
  <p>And I'm having problems in this part:</p>
  
  <p><strong><em>The next step is to create a registration directory on the search path and then add the login.html file.</em></strong></p>
  
  <p>Because I've created that directory and the template but it appears that is not been recognize by my app.</p>
  
  <p><strong>Structure:</strong></p>
  
  <pre><code>Note: Your folder structure should now look like the below:
  locallibrary (Django project folder)
     |_catalog
     |_locallibrary
     |_templates (new)
                  |_registration
  </code></pre>
  
  <p><strong><em>My Structure:</em></strong></p>
  
  <p><a href="https://i.stack.imgur.com/PjD2I.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PjD2I.png" alt="enter image description here"></a></p>
  
  <p>And then for this part:</p>
  
  <p><strong><em>make these directories visible to the template loader</em></strong> </p>
  
  <p>I've: </p>
  
  <pre><code>TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          #'DIRS': [os.path.join(BASE_DIR, 'templates')],
          'DIRS': ['./templates',],
          '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><strong>Project url.pý:</strong></p>
  
  <pre><code>from django.contrib import admin
  from django.urls import path, include
  from main_app import views
  
  
  
  urlpatterns = [
      path('accounts/', include('django.contrib.auth.urls')),
      path('admin/', admin.site.urls),
      path('', include('main_app.urls')),
  
  ]
  </code></pre>
  
  <p>For my login.html template I've:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"&gt;
      &lt;meta name="description" content=""&gt;
      &lt;meta name="author" content=""&gt;
      &lt;link rel="icon" href="../../../../favicon.ico"&gt;
  
      &lt;title&gt;Jumbotron Template for Bootstrap&lt;/title&gt;
  
      &lt;!-- Bootstrap core CSS --&gt;
      &lt;link href="../../dist/css/bootstrap.min.css" rel="stylesheet"&gt;
  
      &lt;!-- Custom styles for this template --&gt;
      &lt;link href="jumbotron.css" rel="stylesheet"&gt;
      &lt;!-- Custom styles for this template --&gt;
  
  
      &lt;link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" rel="stylesheet"&gt;
      &lt;link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js" rel="stylesheet"&gt;
  
      &lt;link href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" rel="stylesheet"/&gt;
  
  
      &lt;link href="{% static 'main_app/style.css' %}" rel="stylesheet"&gt;
  
  
  &lt;/head&gt;
  
  {% block content %}
  
  {% if form.errors %}
  &lt;p&gt;Your username and password didn't match. Please try again.&lt;/p&gt;
  {% endif %}
  
  {% if next %}
      {% if user.is_authenticated %}
      &lt;p&gt;Your account doesn't have access to this page. To proceed,
      please login with an account that has access.&lt;/p&gt;
      {% else %}
      &lt;p&gt;Please login to see this page.&lt;/p&gt;
      {% endif %}
  {% endif %}
  
  &lt;form method="post" action="{% url 'login' %}"&gt;
  {% csrf_token %}
  
  &lt;div&gt;
    &lt;td&gt;{{ form.username.label_tag }}&lt;/td&gt;
    &lt;td&gt;{{ form.username }}&lt;/td&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;td&gt;{{ form.password.label_tag }}&lt;/td&gt;
    &lt;td&gt;{{ form.password }}&lt;/td&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
    &lt;input type="submit" value="login" /&gt;
    &lt;input type="hidden" name="next" value="{{ next }}" /&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  
  {# Assumes you setup the password_reset view in your URLconf #}
  &lt;p&gt;&lt;a href="{% url 'password_reset' %}"&gt;Lost password?&lt;/a&gt;&lt;/p&gt;
  
  {% endblock %}
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>According to the tutorial I should navigate to:</strong> </p>
  
  <p><a href="http://127.0.0.1:8000/accounts/login/" rel="noreferrer">http://127.0.0.1:8000/accounts/login/</a></p>
  
  <p>and see this:</p>
  
  <p><a href="https://i.stack.imgur.com/Gt3k3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Gt3k3.png" alt="enter image description here"></a></p>
  
  <p><strong>But I'm seeing:</strong> </p>
  
  <p>TemplateDoesNotExist at /accounts/login/
  registration/login.html</p>
  
  <p><a href="https://i.stack.imgur.com/PRtVz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PRtVz.png" alt="enter image description here"></a></p>