I am using Django 1.5 and Python 2.7. My project directory is the usual:
There is the project folder called projectFolder. Inside projectFolder, there are two other folders: projFolder and projApp.
Inside projFolder is my settings.py, init.py and urls.py.
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:
SITE_MEDIA_ROOT = os.path.join(
os.path.dirname(__file__), 'projApp/', 'static/', 'site_media'
)
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
SITE_MEDIA_ROOT = os.path.join(
os.path.dirname(__file__), '../', 'projApp/', 'static/', 'site_media'
)
? From my understanding,
os.path.dirname(__file__)
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
os.path.dirname(__file__), 'projApp/', 'static/', 'site_media'
mean that Django should search
projectFolder/projFolder/projApp/static
? If yes, then how is it finding static without backing out of the current settings.py directory first?