update settings
This commit is contained in:
22
deploy/run.sh
Normal file
22
deploy/run.sh
Normal 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
|
||||
Reference in New Issue
Block a user