title: Django TemplateDoesNotExist?
body: <p>My local machine is running Python 2.5 and Nginx on Ubuntu 8.10, with Django builded from latest development trunk.</p>
  
  <p>For every URL I request, it throws:</p>
  
  <blockquote>
    <p>TemplateDoesNotExist at /appname/path appname/template_name.html</p>
    
    <p>Django tried loading these templates, in this order:
    * Using loader django.template.loaders.filesystem.function:
    * Using loader django.template.loaders.app_directories.function: </p>
    
    <p>TEMPLATE_DIRS 
      ('/usr/lib/python2.5/site-packages/projectname/templates',)</p>
  </blockquote>
  
  <p>Is it looking for <strong>/usr/lib/python2.5/site-packages/projectname/templates/appname/template_name.html</strong> in this case? The weird thing is this file does existed on disk. Why can't Django locate it?</p>
  
  <p>I run the same application on a remote server with Python 2.6 on Ubuntu 9.04 without such problem. Other settings are the same.</p>
  
  <p>Is there anything misconfigured on my local machine, or what could possibly have caused such errors that I should look into?</p>
  
  <p>In my <strong>settings.py</strong>, I have specified:</p>
  
  <pre><code>SETTINGS_PATH = os.path.normpath(os.path.dirname(__file__))
  # Find templates in the same folder as settings.py.
  TEMPLATE_DIRS = (
      os.path.join(SETTINGS_PATH, 'templates'),
  )
  </code></pre>
  
  <p>It should be looking for the following files:</p>
  
  <ul>
  <li>/usr/lib/python2.5/site-packages/projectname/templates/appname1/template1.html</li>
  <li>/usr/lib/python2.5/site-packages/projectname/templates/appname1/template2.html</li>
  <li>/usr/lib/python2.5/site-packages/projectname/templates/appname2/template3.html</li>
  <li>...</li>
  </ul>
  
  <p>All the above files exist on disk.</p>
  
  <p><strong>Solved</strong></p>
  
  <p>It works now after I tried:</p>
  
  <pre><code>chown -R www-data:www-data /usr/lib/python2.5/site-packages/projectname/*
  </code></pre>
  
  <p>It's strange. I don't need to do this on the remote server to make it work.</p>