diff --git a/cms/envs/common.py b/cms/envs/common.py index 3226d99005..1767202141 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -94,8 +94,9 @@ JASMINE_TEST_DIRECTORY = PROJECT_ROOT + '/static/coffee' #################### CAPA External Code Evaluation ############################# XQUEUE_INTERFACE = { 'url': 'http://localhost:8888', - 'auth': {'username': 'local', - 'password': 'local'} + 'django_auth': {'username': 'local', + 'password': 'local'}, + 'basic_auth': None, } diff --git a/common/lib/capa/capa/xqueue_interface.py b/common/lib/capa/capa/xqueue_interface.py index 9573599245..d9822d24f3 100644 --- a/common/lib/capa/capa/xqueue_interface.py +++ b/common/lib/capa/capa/xqueue_interface.py @@ -60,10 +60,10 @@ class XQueueInterface: Interface to the external grading system ''' - def __init__(self, url, auth): + def __init__(self, url, django_auth, basic_auth=None): self.url = url - self.auth = auth - self.session = requests.session() + self.auth = django_auth + self.session = requests.session(auth=basic_auth) def send_to_queue(self, header, body, file_to_upload=None): ''' diff --git a/lms/djangoapps/courseware/module_render.py b/lms/djangoapps/courseware/module_render.py index 46889c878b..08c11b50b7 100644 --- a/lms/djangoapps/courseware/module_render.py +++ b/lms/djangoapps/courseware/module_render.py @@ -25,7 +25,8 @@ log = logging.getLogger("mitx.courseware") xqueue_interface = XQueueInterface( settings.XQUEUE_INTERFACE['url'], - settings.XQUEUE_INTERFACE['auth'] + settings.XQUEUE_INTERFACE['django_auth'], + settings.XQUEUE_INTERFACE['basic_auth'], ) diff --git a/lms/envs/dev.py b/lms/envs/dev.py index 38d38034b5..882a82b8f0 100644 --- a/lms/envs/dev.py +++ b/lms/envs/dev.py @@ -55,10 +55,11 @@ CACHES = { XQUEUE_INTERFACE = { "url": "http://xqueue.sandbox.edx.org", - "auth": { + "django_auth": { "username": "lms", "password": "***REMOVED***" - } + }, + "basic_auth": ('anant', 'agarwal'), } # Make the keyedcache startup warnings go away diff --git a/lms/envs/test.py b/lms/envs/test.py index 7af7acfc37..187cb5c68e 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -52,10 +52,11 @@ GITHUB_REPO_ROOT = ENV_ROOT / "data" XQUEUE_INTERFACE = { "url": "http://xqueue.sandbox.edx.org", - "auth": { + "django_auth": { "username": "lms", "password": "***REMOVED***" - } + }, + "basic_auth": ('anant', 'agarwal'), }