summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2018-01-05 15:47:05 +0530
committerGitHub2018-01-05 15:47:05 +0530
commit65ce10a9057d30e6a7e9a37926abdef97e5fdc48 (patch)
tree8cf8c7ef08b63b68013dce99faf14223c2f73764 /yaksh/models.py
parentfeb295b4107a95621e9430f5c7042cfde4674cc0 (diff)
parentbbf844c6ebf9b29c436930b5d5129ebf77a3aad1 (diff)
downloadonline_test-65ce10a9057d30e6a7e9a37926abdef97e5fdc48.tar.gz
online_test-65ce10a9057d30e6a7e9a37926abdef97e5fdc48.tar.bz2
online_test-65ce10a9057d30e6a7e9a37926abdef97e5fdc48.zip
Merge pull request #404 from ankitjavalkar/add-docker-compose-test
Add docker compose deployment
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 1d24bda..2f616cf 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_port)
submit(url, uid, json_data, user_dir)
result = {'uid': uid, 'status': 'running'}
return result
@@ -1740,7 +1740,7 @@ class AnswerPaper(models.Model):
server_port=server_port
)
if question.type == "code":
- url = 'http://localhost:%s' % server_port
+ url = '{0}:{1}'.format(SERVER_HOST_NAME, server_port)
check_result = get_result_from_code_server(url, result['uid'],
block=True
)