简体   繁体   中英

Go above BASE_DIR in django

I am new to Django, Quite Confused here.

This is BASE_DIR

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

└── MY_PROJECT
 │   MY_APP
 ├── BASE_DIR
 │   ├── settings.py
 │   │   /**
           ALL OTHER FILES **/
     └── manage.py

Now, How should I access my app directory in a settings.py file ??

vision is the project name, api is the app

This is BASE_DIR which gets printed:

/Users/roger/Desktop/WebDevelopment/mine/vision/vision

os.path.join(BASE_DIR, '..', 'MY_APP')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM