Commit 8c64c644 by Edward Zarecor

/ operator requires a path, fails on two string

parent a6ec3170
import yaml import yaml
from .common import * # pylint: disable=unused-wildcard-import, wildcard-import from .common import * # pylint: disable=unused-wildcard-import, wildcard-import
from path import path
from django.core.exceptions import ImproperlyConfigured
############################################################################### ###############################################################################
# Explicitly declare here in case someone changes common.py. # Explicitly declare here in case someone changes common.py.
...@@ -11,7 +12,12 @@ TEMPLATE_DEBUG = False ...@@ -11,7 +12,12 @@ TEMPLATE_DEBUG = False
DISABLE_TOKEN_CHECK = False DISABLE_TOKEN_CHECK = False
############################################################################### ###############################################################################
CONFIG_ROOT = os.environ.get('EDXNOTES_CONFIG_ROOT') EDXNOTES_CONFIG_ROOT = os.environ.get('EDXNOTES_CONFIG_ROOT')
if not EDXNOTES_CONFIG_ROOT:
raise ImproperlyConfigured("EDXNOTES_CONFIG_ROOT must be defined in the environment.")
CONFIG_ROOT = path(EDXNOTES_CONFIG_ROOT)
with open(CONFIG_ROOT / "edx-notes-api.yml") as yaml_file: with open(CONFIG_ROOT / "edx-notes-api.yml") as yaml_file:
config_from_yaml = yaml.load(yaml_file) config_from_yaml = yaml.load(yaml_file)
......
...@@ -8,3 +8,4 @@ django-cors-headers==0.13 ...@@ -8,3 +8,4 @@ django-cors-headers==0.13
PyJWT==0.3.0 PyJWT==0.3.0
MySQL-python==1.2.5 # GPL License MySQL-python==1.2.5 # GPL License
gunicorn==19.1.1 # MIT gunicorn==19.1.1 # MIT
path.py==3.0.1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment