From c883413f4e7ef4642f9d18a0d383612f6abd9391 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 15 Nov 2017 16:50:24 +0530 Subject: - Add python-decouple package to requirements - Use sane defaults and python-decouple in yaksh.settings module - Replace hard coded localhost domain name referring to code server with dynamic settings variable --- yaksh/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 1d24bda..bc0b4f1 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -29,10 +29,10 @@ import tempfile from textwrap import dedent from ast import literal_eval from .file_utils import extract_files, delete_files -from yaksh.code_server import(submit, - get_result as get_result_from_code_server - ) -from yaksh.settings import SERVER_POOL_PORT +from yaksh.code_server import ( + submit, get_result as get_result_from_code_server +) +from yaksh.settings import SERVER_POOL_PORT, SERVER_HOST_NAME from django.conf import settings from django.forms.models import model_to_dict @@ -1705,7 +1705,7 @@ class AnswerPaper(models.Model): elif question.type == 'code' or question.type == "upload": user_dir = self.user.profile.get_user_dir() - url = 'http://localhost:%s' % server_port + url = '{0}:{1}'.format(SERVER_HOST_NAME, SERVER_POOL_PORT) submit(url, uid, json_data, user_dir) result = {'uid': uid, 'status': 'running'} return result -- cgit