Setup django before launching daphne + Django

This commit is contained in:
Martin Pépin 2017-08-10 16:55:36 +01:00
parent 4075fcaa64
commit 73296ea251

View file

@ -38,6 +38,14 @@ sudo -H -u ubuntu python3 -m venv ~ubuntu/venv
sudo -H -u ubuntu ~ubuntu/venv/bin/pip install -U pip
sudo -H -u ubuntu ~ubuntu/venv/bin/pip install -r /vagrant/requirements-devel.txt
# Préparation de Django
cd /vagrant
ln -s -f secret_example.py cof/settings/secret.py
sudo -H -u ubuntu DJANGO_SETTINGS_MODULE='cof.settings.dev' bash provisioning/prepare_django.sh
# Installation du cron pour les mails de rappels
sudo -H -u ubuntu crontab provisioning/cron.dev
# Daphne + runworker
cp /vagrant/provisioning/daphne.service /etc/systemd/system/daphne.service
cp /vagrant/provisioning/worker.service /etc/systemd/system/worker.service
@ -57,12 +65,3 @@ source ~/venv/bin/activate
# On va dans /vagrant où se trouve le code de gestioCOF
cd /vagrant
EOF
cd /vagrant
# Préparation de Django
ln -s -f secret_example.py cof/settings/secret.py
sudo -H -u ubuntu DJANGO_SETTINGS_MODULE='cof.settings.dev' bash provisioning/prepare_django.sh
# Installation du cron pour les mails de rappels
sudo -H -u ubuntu crontab provisioning/cron.dev