diff --git a/deploy/supervisord.conf b/deploy/supervisord.conf index b1740466..4e590165 100644 --- a/deploy/supervisord.conf +++ b/deploy/supervisord.conf @@ -39,7 +39,7 @@ stopwaitsecs = 5 killasgroup=true [program:dramatiq] -command=python3 manage.py rundramatiq --no-reload --processes %(ENV_MAX_WORKER_NUM)s --threads 4 +command=python3 manage.py rundramatiq --processes %(ENV_MAX_WORKER_NUM)s --threads 4 directory=/app/ user=nobody stdout_logfile=/data/log/dramatiq.log diff --git a/oj/dev_settings.py b/oj/dev_settings.py index 4736c69f..f79cc876 100644 --- a/oj/dev_settings.py +++ b/oj/dev_settings.py @@ -1,22 +1,23 @@ # coding=utf-8 import os +from utils.shortcuts import get_env BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'HOST': '127.0.0.1', - 'PORT': 5435, - 'NAME': "onlinejudge", - 'USER': "onlinejudge", - 'PASSWORD': 'onlinejudge' + 'HOST': get_env('POSTGRES_HOST', '127.0.0.1'), + 'PORT': get_env('POSTGRES_PORT', '5435'), + 'NAME': get_env('POSTGRES_DB', 'onlinejudge'), + 'USER': get_env('POSTGRES_USER', 'onlinejudge'), + 'PASSWORD': get_env('POSTGRES_PASSWORD', 'onlinejudge') } } REDIS_CONF = { - "host": "127.0.0.1", - "port": "6380" + 'host': get_env('REDIS_HOST', '127.0.0.1'), + 'port': get_env('REDIS_PORT', '6380') }