Last active
October 19, 2018 19:23
-
-
Save adamghill/7884854 to your computer and use it in GitHub Desktop.
Shell script to start up a Django project using pipenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
PIPENV_VENV_IN_PROJECT=1 pipenv --version | |
if [ $? -eq 0 ]; then | |
if [ "$1" == "--install" ]; then | |
PIPENV_VENV_IN_PROJECT=1 pipenv install --dev | |
fi | |
PIPENV_VENV_IN_PROJECT=1 pipenv run python manage.py migrate --noinput && | |
PIPENV_VENV_IN_PROJECT=1 PYTHONDONTWRITEBYTECODE=1 pipenv run python manage.py runserver --settings=project.settings 0:8000 | |
else | |
echo "ERROR: pipenv install failed." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment