#!/bin/bash -e
sudo python3-pip install -r pipreqs
if [ -z "$APP_MODE" -o "$APP_MODE" == "dev" ]; then
    sudo python3-pip install -r pipreqs-dev
fi
python3 manage.py migrate
exit 0

#!/bin/bash -e


if [ -z $(which python3-pip) ]; then 
    PIP_CMD=$(which pip) 
    PYTHON_CMD=$(which python)
else
    PIP_CMD=$(which python3-pip) 
    PYTHON_CMD=$(which python3)
fi

sudo ${PIP_CMD} install -r pipreqs
if [ -z "$APP_MODE" -o "$APP_MODE" == "dev" ]; then
    sudo ${PIP_CMD} install -r pipreqs-dev
fi
${PYTHON_CMD} manage.py migrate
exit 0

Make setup work in virtualenvs too, plus run migrate on every setup
Make setup work in virtualenvs too, plus run migrate on every setup
