title: Django: TemplateDoesNotExist at /home/
body: <p>I am trying to add a template which displays a <code>ModelForm</code> on my Django app's home page. I made a separate app within my project for the home page called <code>home</code> since it isn't static, but the template I'm using is living in the main templates directory used by my project right now. </p>
  
  <p>When I run my server and try to navigate to /home, I get the following error: </p>
  
  <pre><code>TemplateDoesNotExist at /home/
  {'form': &lt;ActionCodeForm bound=False, valid=Unknown, fields=(action_code)&gt;}
  Request Method: GET
  Request URL:    http://127.0.0.1:8300/home/
  Django Version: 1.9.7
  Exception Type: TemplateDoesNotExist
  Exception Value:    
  {'form': &lt;ActionCodeForm bound=False, valid=Unknown, fields=(action_code)&gt;}
  </code></pre>
  
  <p>How do I fix this error? I have tried looking at other SO answers for TemplateDoesNotExist errors and saw that it has to do with the <code>'DIRS'</code> setting but mine seems to be set up correctly so I don't know what would be causing the error.</p>
  
  <p>Here is the templates section of my <code>settings.py</code>:</p>
  
  <pre><code>TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, '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>Here's the template (<code>action_code_form.html</code>):</p>
  
  <pre><code>&lt;form method="post" action=""&gt;
  {% csrf_token %}
  &lt;table&gt;
  {{ form }}
  &lt;/table&gt;
  &lt;input type="submit" value="Submit"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is home/views.py: </p>
  
  <pre><code>from home.forms import ActionCodeForm
  
  def action_code_form(request):
      form = ActionCodeForm()
      if request.method == 'POST':
          form = ActionCodeForm(request.POST)
          if form.is_valid():
              action_code = form.cleaned_data['action_code']
              form.save()
      return render('action_code_form.html', {'form': form})
  </code></pre>
  
  <p>home/models.py: </p>
  
  <pre><code>class ActionCode(models.Model):
      action_code = models.CharField(blank=False, max_length=10,
                                     verbose_name="Action Code")
  </code></pre>
  
  <p>home/forms.py:</p>
  
  <pre><code>from home.models import ActionCode
  
  class ActionCodeForm(ModelForm):
      class Meta:
          model = ActionCode
          fields = ('action_code',)
  </code></pre>