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

22
deploy/run.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
BASE=/app
if [ ! -f "$BASE/custom_settings.py" ]; then
echo SECRET_KEY=\"$(cat /dev/urandom | head -1 | md5sum | head -c 32)\" >> /app/oj/custom_settings.py
fi
if [ ! -d "$BASE/log" ]; then
mkdir -p $BASE/log
fi
cd $BASE
find . -name "*.pyc" -delete
python manage.py migrate
if [ $? -ne 0 ]; then
echo "Can't start server"
exit 1
fi
python manage.py initadmin
python manage.py runserver 0.0.0.0:8080