Skip to content

Instantly share code, notes, and snippets.

@douglasmiranda
Created March 13, 2012 14:22
Show Gist options
  • Save douglasmiranda/2029087 to your computer and use it in GitHub Desktop.
Save douglasmiranda/2029087 to your computer and use it in GitHub Desktop.
Python: Get the parent dir relative to the current python file. # Using in Django, maybe need to refactor.
from os.path import abspath, join, dirname
PROJECT_ROOT_PATH = abspath(join(dirname(abspath(__file__)), '..'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment