mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-06 04:21:51 +00:00
29 lines
588 B
Python
29 lines
588 B
Python
import os
|
|
|
|
|
|
def get_env(name, default=""):
|
|
return os.environ.get(name, default)
|
|
|
|
|
|
DATABASES = {
|
|
'default': {
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
'HOST': get_env("POSTGRES_HOST", "oj-postgres"),
|
|
'PORT': get_env("POSTGRES_PORT", "5432"),
|
|
'NAME': get_env("POSTGRES_DB"),
|
|
'USER': get_env("POSTGRES_USER"),
|
|
'PASSWORD': get_env("POSTGRES_PASSWORD")
|
|
}
|
|
}
|
|
|
|
REDIS_CONF = {
|
|
"host": get_env("REDIS_HOST", "oj-redis"),
|
|
"port": get_env("REDIS_PORT", "6379")
|
|
}
|
|
|
|
DEBUG = False
|
|
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
DATA_DIR = "/data"
|