diff options
-rw-r--r-- | soc/settings.py | 22 | ||||
-rw-r--r-- | website/helpers.py | 4 |
2 files changed, 12 insertions, 14 deletions
diff --git a/soc/settings.py b/soc/settings.py index 134c52d..2352285 100644 --- a/soc/settings.py +++ b/soc/settings.py @@ -19,21 +19,19 @@ MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': 'soc', # Or path to database file if using sqlite3. - # The following settings are not used with sqlite3: - 'USER': DB_USER, - 'PASSWORD': DB_PASS, - 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. - 'PORT': '', # Set to empty string for default. + 'NAME': DB_NAME_DEFAULT, # Or path to database file if using sqlite3. + 'USER': DB_USER_DEFAULT, + 'PASSWORD': DB_PASS_DEFAULT, + 'HOST': DB_HOST_DEFAULT, # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. + 'PORT': DB_PORT_DEFAULT, # Set to empty string for default. }, 'scilab': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': 'scilab', # Or path to database file if using sqlite3. - # The following settings are not used with sqlite3: - 'USER': DB_USER, - 'PASSWORD': DB_PASS, - 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. - 'PORT': '', # Set to empty string for default. + 'NAME': DB_NAME_SCILAB, # Or path to database file if using sqlite3. + 'USER': DB_USER_SCILAB, + 'PASSWORD': DB_PASS_SCILAB, + 'HOST': DB_HOST_SCILAB, # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. + 'PORT': DB_PORT_SCILAB, # Set to empty string for default. } } diff --git a/website/helpers.py b/website/helpers.py index b3894ba..aa20c5b 100644 --- a/website/helpers.py +++ b/website/helpers.py @@ -2,7 +2,7 @@ import os, re, sys, time, subprocess from soc.settings import PROJECT_DIR from timeout import TimerTask -from soc.config import SCILAB_BIN, SCIMAX_LOADER, UPLOADS_PATH +from soc.config import SCILAB_BIN, SCILAB_FLAGS, SCIMAX_LOADER, UPLOADS_PATH def scilab_run(code, token, book_id, dependency_exists): #Check for system commands @@ -52,7 +52,7 @@ def scilab_run(code, token, book_id, dependency_exists): #this makes it possible to execute scilab without the problem of \ #getting stuck in the prompt in case of error cmd = 'printf "exec(\'{0}\',2);\nquit();"'.format(file_path) - cmd += ' | {0} -nw'.format(SCILAB_BIN) + cmd += ' | {0} {1}'.format(SCILAB_BIN, SCILAB_FLAGS) task = TimerTask(cmd, timeout=15) output = task.run().communicate()[0] |