Forked from soulston/Django absolute paths for settings.py
Created
May 31, 2014 07:27
-
-
Save eirenik0/e983e461aaae68024127 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| # here() gives us file paths from the root of the system to the directory | |
| # holding the current file. | |
| here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) | |
| PROJECT_ROOT = here("..") | |
| # root() gives us file paths from the root of the system to whatever | |
| # folder(s) we pass it starting at the parent directory of the current file. | |
| root = lambda * x: os.path.join(os.path.abspath(PROJECT_ROOT), *x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment