Reputation: 510
I have a simple question:
I have read a lot of answers in this forum on how to get a project's root directory. However I'm running into a problem: the path is just .
For example:
from django.conf import settings
path = settings.BASE_DIR + /somefolder/
the resulting value for path is just .
I need the full path in order to save to that folder.
Upvotes: 1
Views: 3289
Reputation: 19806
Use the following:
import os
from django.conf import settings
folder_path = os.path.join(settings.BASE_DIR, 'somefolder')
Upvotes: 3