Abhishek Soam
Abhishek Soam

Reputation: 45

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

Upvotes: 1

Views: 1118

Answers (1)

Bernhard
Bernhard

Reputation: 8831

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

Upvotes: 3

Related Questions