The architecture of a project in Django
Inside settings.py:
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
-> gives the path of the file settings.py: root/main/. This is NOT THE ROOT OF THE PROJECT
PROJECT_PATH = os.path.abspath(os.path.dirname(__name__))
-> gives the root of the project: root/. This is THE ROOT OF THE PROJECT.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…