-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
17 lines (16 loc) · 875 Bytes
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
sudo pip3 install -U django==2.0.7
sudo sed -i -e "s/\/sbin\/python/\/sbin\/python3/" -e "s/17.5/19.6/" /usr/sbin/gunicorn-debian
sudo sed -i -e "s/\/sbin\/python/\/sbin\/python3/" -e "s/17.5/19.6/" /usr/bin/gunicorn
sudo sed -i -e "s/\/sbin\/python/\/sbin\/python3/" -e "s/17.5/19.6/" /usr/bin/gunicorn_django
sudo sed -i -e "s/\/sbin\/python/\/sbin\/python3/" -e "s/17.5/19.6/" /usr/bin/gunicorn_paster
sudo unlink /etc/nginx/sites-enabled/default
sudo ln -s /home/box/web/etc/nginx.conf /etc/nginx/sites-enabled/test.conf
sudo /etc/init.d/nginx restart
sudo ln -s /home/box/web/etc/django_site.py /etc/gunicorn.d/django_site.py
sudo /etc/init.d/mysql restart
mysql -u root -e "create database qa_db;"
cd /home/box/web/ask/
python3 manage.py makemigrations
python3 manage.py migrate
sudo gunicorn -c /etc/gunicorn.d/django_site.py ask.wsgi:application