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/settings.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'yaksh/settings.py') diff --git a/yaksh/settings.py b/yaksh/settings.py index d500d93..e414e75 100644 --- a/yaksh/settings.py +++ b/yaksh/settings.py @@ -2,16 +2,21 @@ settings for yaksh app. """ +from decouple import config + # The number of code server processes to run.. -N_CODE_SERVERS = 5 +N_CODE_SERVERS = config('N_CODE_SERVERS', default=5, cast=int) # The server pool port. This is the server which returns available server # ports so as to minimize load. This is some random number where no other # service is running. It should be > 1024 and less < 65535 though. -SERVER_POOL_PORT = 53579 +SERVER_POOL_PORT = config('EMAIL_PORT', default=55555, cast=int) + +SERVER_HOST_NAME = config('SERVER_HOST_NAME', default='http://localhost') +#'localhost' # Timeout for the code to run in seconds. This is an integer! -SERVER_TIMEOUT = 4 +SERVER_TIMEOUT = config('SERVER_TIMEOUT', default=4, cast=int) # The root of the URL, for example you might be in the situation where you # are not hosted as host.org/exam/ but as host.org/foo/exam/ for whatever -- cgit From 6f2e29a067cbeaf88b8ea478bb7c24fe8772180a Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 20 Nov 2017 16:07:43 +0530 Subject: Multiple Changes: - Add python-decouple package to requirements - use sane defaults and python-decouple in yaksh.settings and online_test.settings module - Replace hardcoded localhost domain name referring to code server with dynamic - Move Dockerfile to dedicated directory - Add dynamic run-as-admin commands to the base command depending on OS - Replace linux specific commands like cp with Python functions --- yaksh/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/settings.py') diff --git a/yaksh/settings.py b/yaksh/settings.py index e414e75..d895d19 100644 --- a/yaksh/settings.py +++ b/yaksh/settings.py @@ -10,7 +10,7 @@ N_CODE_SERVERS = config('N_CODE_SERVERS', default=5, cast=int) # The server pool port. This is the server which returns available server # ports so as to minimize load. This is some random number where no other # service is running. It should be > 1024 and less < 65535 though. -SERVER_POOL_PORT = config('EMAIL_PORT', default=55555, cast=int) +SERVER_POOL_PORT = config('SERVER_POOL_PORT', default=55555, cast=int) SERVER_HOST_NAME = config('SERVER_HOST_NAME', default='http://localhost') #'localhost' -- cgit