I recently upgrade Django from v1.3.1 to v1.4.
In my old settings.py I have
settings.py
TEMPLATE_DIRS = ( os.path.join(os.path.dirname( __file_
This might be useful for other cases where you want to go x folders up. Just run walk_up_folder(path, 6) to go up 6 folders.
walk_up_folder(path, 6)
def walk_up_folder(path, depth=1): _cur_depth = 1 while _cur_depth < depth: path = os.path.dirname(path) _cur_depth += 1 return path