title: Django can't load template
body: <p>I've tried this several ways with no luck. If I try to render my view like this:</p>
  
  <pre><code>from django.shortcuts import render
  from django.template import loader
  
  def index(request):
      render(request, loader.get_template('index.html'))
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>TemplateDoesNotExist at /
  </code></pre>
  
  <p>If I change the code to this:</p>
  
  <pre><code>from django.http import HttpResponse
  from django.template.loader import render_to_string
  
  def index(request):
      content = render_to_string('index.html')
      HttpResponse(content)
  </code></pre>
  
  <p>It actually finds the template and renders it (<code>content</code> gets set to the rendered html) but I get this error now:</p>
  
  <pre><code>ValueError at /
  The view home.controller.index didn't return an HttpResponse object.
  </code></pre>
  
  <p>Here is my folder structure and my settings:</p>
  
  <pre><code>myProject/
      settings.py
  
      home/
         controller.py
         urls.py
         models.py
         templates/
             home/
                 index.html
  </code></pre>
  
  <p>Inside my setting.py file I have:</p>
  
  <pre><code>SITE_ROOT = os.path.dirname(os.path.realpath(__name__))
  TEMPLATE_DIRS = ( os.path.join(SITE_ROOT, 'home/templates/home'), )
  
  INSTALLED_APPS = (
      'django.contrib.sessions',
      'django.contrib.staticfiles',
      'gunicorn',
      'home'
  )
  </code></pre>
  
  <p>I've tried multiple variations for <code>TEMPLATE_DIRS</code> but it's suppose to just pick it up correctly since I have <code>home</code> added as an app I thought. Anyone know what's happening here?</p>
  
  <p><strong>UPDATE</strong>  </p>
  
  <p>A combination of things fixed this. First of all a <code>return</code> statement is required (<em>doh</em>) and I think I was mixing examples of how to render a template. No need to import the loader or render it manually. This is what I wound up with that actually worked:</p>
  
  <pre><code>from django.shortcuts import render
  
  def index(request):
      return render(request, 'home/index.html')
  </code></pre>
  
  <p>Thanks to @lalo and @Rao for pointing me in the right direction.</p>