update settings

This commit is contained in:
zema1
2017-10-23 10:47:26 +08:00
parent 5d03ec5aab
commit 1b0952cd0d
10 changed files with 233 additions and 82 deletions

28
oj/production_settings.py Normal file
View File

@@ -0,0 +1,28 @@
import os
def get_env(name, default=""):
return os.environ.get(name, default)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': get_env("POSTGRESQL_HOST", "postgresql"),
'PORT': get_env("POSTGRESQL_PORT", "5433"),
'NAME': get_env("POSTGRESQL_DBNAME"),
'USER': get_env("POSTGRESQL_USER"),
'PASSWORD': get_env("POSTGRESQL_PASSWORD")
}
}
REDIS_CONF = {
"host": get_env("REDIS_HOST", "redis"),
"port": get_env("REDIS_PORT", "6379")
}
DEBUG = False
ALLOWED_HOSTS = ['*']
TEST_CASE_DIR = "/test_case"