Adjust settings so we can change the comments service URL from Django config

This commit is contained in:
David Ormsbee
2012-08-20 17:33:45 -04:00
parent 47bf516001
commit b6dfa50a73
2 changed files with 8 additions and 1 deletions

View File

@@ -60,3 +60,5 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE']
if 'COURSE_ID' in ENV_TOKENS:
ASKBOT_URL = "courses/{0}/discussions/".format(ENV_TOKENS['COURSE_ID'])
COMMENTS_SERVICE_URL = ENV_TOKENS["COMMENTS_SERVICE_URL"]

View File

@@ -1,3 +1,8 @@
SERVICE_HOST = 'http://localhost:4567'
from django.conf import settings
if hasattr(settings, "COMMENTS_SERVICE_URL"):
SERVICE_HOST = settings.COMMENTS_SERVICE_URL
else:
SERVICE_HOST = 'http://localhost:4567'
PREFIX = SERVICE_HOST + '/api/v1'