Set sys.path properly for docs to build.

We used to do it this way, I'm not sure why it was changed.
Our settings files add directories to the path, so we need to
do it here so that names will be importable.
This commit is contained in:
Ned Batchelder
2013-07-10 11:38:00 -04:00
parent dcaed88cb2
commit a3d496a882

View File

@@ -21,7 +21,17 @@ import os
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../..')) # mitx folder
mitx = os.path.abspath('../..')
sys.path.append(mitx)
sys.path.append(os.path.join(mitx, "common/djangoapps"))
sys.path.append(os.path.join(mitx, "common/lib"))
sys.path.append(os.path.join(mitx, "common/lib/sandbox-packages"))
sys.path.append(os.path.join(mitx, "lms/djangoapps"))
sys.path.append(os.path.join(mitx, "lms/lib"))
sys.path.append(os.path.join(mitx, "cms/djangoapps"))
sys.path.append(os.path.join(mitx, "cms/lib"))
# django configuration - careful here
os.environ['DJANGO_SETTINGS_MODULE'] = 'lms.envs.test'