This logic would be much easier to read if you used [`path.py`](http://pythonhosted.org/path.py/api.html). The settings file already uses that API at the top of the file, although it seems to lose interest down at the bottom. :(