title: Clarification on how to use os.path.dirname with Django
body: <p>I am using Django 1.5 and Python 2.7. My project directory is the usual:</p>
  
  <p>There is the project folder called projectFolder. Inside projectFolder, there are two other folders: projFolder and projApp. </p>
  
  <p>Inside projFolder is my settings.py, <strong>init</strong>.py and urls.py. </p>
  
  <p>Inside projApp is my models.py, views.py and my static folder which holds my templates. Now, in my settings.py file, I have the following:</p>
  
  <pre><code>SITE_MEDIA_ROOT = os.path.join(
      os.path.dirname(__file__), 'projApp/', 'static/', 'site_media' 
  )
  </code></pre>
  
  <p>The lines of code above work perfectly fine and this is what I read in the tutorial I was following. However, shouldn't it be</p>
  
  <pre><code>SITE_MEDIA_ROOT = os.path.join(
      os.path.dirname(__file__), '../', 'projApp/', 'static/', 'site_media' 
  )
  </code></pre>
  
  <p>? From my understanding,</p>
  
  <pre><code>os.path.dirname(__file__)
  </code></pre>
  
  <p>is the path to the directory which the current file is in, correct? So that would be projFolder since settings.py is in projFolder. So shouldn't I back out of the current directory first and then enter the projApp folder in order to get to the static folder? Doesn't the line</p>
  
  <pre><code>os.path.dirname(__file__), 'projApp/', 'static/', 'site_media' 
  </code></pre>
  
  <p>mean that Django should search</p>
  
  <pre><code>projectFolder/projFolder/projApp/static
  </code></pre>
  
  <p>? If yes, then how is it finding static without backing out of the current settings.py directory first?</p>