#!/bin/bash

python manage.py migrate --settings=clipper.production

python manage.py collectstatic --noinput --settings=clipper.production

python manage.py crontab add

{
    echo "SHELL=/bin/bash"
    echo "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
    echo "DJANGO_SETTINGS_MODULE=clipper.production"
    crontab -l
} | crontab -

service cron start

gunicorn clipper.wsgi:application --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=clipper.production