修改部分设置

This commit is contained in:
virusdefender 2016-04-28 13:46:31 +08:00
parent 9352f8648a
commit 2da8d3de72
No known key found for this signature in database
GPG Key ID: 1686FB5677979E61
6 changed files with 36 additions and 19 deletions

View File

@ -1,12 +1,12 @@
redis:
image: redis
# volumes:
# - /home/data/redis:/data
volumes:
- /home/data/vj_redis:/data
mysql:
image: mysql
# volumes:
# - /home/data/mysql:/var/lib/mysql
volumes:
- /home/data/vj_mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD={YOUR_PASSWORD}
@ -17,8 +17,8 @@ openvj_server:
links:
- redis:redis
- mysq;:mysql
ports:
- "127.0.0.1:8090:8080"
environment:
- vj_env=server
- MYSQL_ENV_MYSQL_USER=root
ports:
- "127.0.0.1:8090:8080"
environment:
- vj_env=server
- MYSQL_ENV_MYSQL_USER=root

View File

@ -1,4 +1,9 @@
#!/usr/bin/env bash
if [ ! -f "/code/openoj/custom_settings.py" ]; then
cp /code/openvj/custom_settings.example.py /code/openvj/custom_settings.py
echo "SECRET_KEY=\"`cat /dev/urandom | head -1 | md5sum | head -c 32`\"" >> /code/openvj/custom_settings.py
fi
find /code -name "*.pyc" -delete
python -m compileall /code
gunicorn openvj.wsgi:application -b 0.0.0.0:8080 --user nobody --group nogroup --reload &
wait

View File

@ -1 +1,2 @@
SECRET_KEY = ""
# please set your own SECRET_KEY to a long random string
# SECRET_KEY = ""

View File

@ -9,6 +9,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases

View File

@ -7,17 +7,31 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = ['*']
# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.mysql',
'NAME': "oj",
'CONN_MAX_AGE': 0.1,
'HOST': os.environ["MYSQL_PORT_3306_TCP_ADDR"],
'PORT': 3306,
'USER': os.environ["MYSQL_ENV_MYSQL_USER"],
'PASSWORD': os.environ["MYSQL_ENV_MYSQL_ROOT_PASSWORD"]
}
}
BROKER_URL = 'amqp://guest:guest@localhost//'
REDIS_QUEUE = {
"host": os.environ["REDIS_PORT_6379_TCP_ADDR"],
"port": 6379,
"db": 3
}
# celery配置
BROKER_URL = 'redis://%s:%s/%s' % (REDIS_QUEUE["host"], str(REDIS_QUEUE["port"]), str(REDIS_QUEUE["db"]))
CELERY_RESULT_BACKEND = "redis"

View File

@ -30,10 +30,6 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [