Django: Difference between BASE_DIR and PROJECT_ROOT?
Question:
From settings.py:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
What’s the difference between these two?
Answers:
They’re almost the same thing. BASE_DIR
is where your manage.py
lies, and PROJECT_ROOT
is BASE_DIR
+ your_project_name (where settings.py
is).
From settings.py:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
What’s the difference between these two?
They’re almost the same thing. BASE_DIR
is where your manage.py
lies, and PROJECT_ROOT
is BASE_DIR
+ your_project_name (where settings.py
is).