title: os.getcwd() vs os.path.abspath(os.path.dirname(__file__))
body: <p>I am using the os module to have relative paths in my Django projects <code>settings.py</code> file. The variable SITE_ROOT is set to the current working directory of the <code>settings.py</code> file and then used to reference all of the <code>static/media</code> directories also located in that same directory. </p>
  
  <p>Heres my issue:</p>
  
  <pre><code>print os.getcwd()
  print os.path.abspath(os.path.dirname(__file__))
  </code></pre>
  
  <p>In settings.py, the above statements both have identical outputs. but my template will only load if I use <code>SITE_ROOT = os.path.abspath(os.path.dirname(__file__))</code></p>
  
  <p>Django looks for the templates here:</p>
  
  <pre><code>TEMPLATE_DIRS = (
      os.path.join(SITE_ROOT, 'templates'),
  )
  </code></pre>
  
  <p>SITE_ROOT set to <code>os.getcwd()</code> seems to make Django look for the templates folder in the directory ABOVE the <code>settings.py</code> file</p>
  
  <p>I can just as easily not use <code>os.getcwd()</code> and my site runs fine, but I am curious what may be going on here :)</p>
  
  <p>Anyone know?</p>