Skip to content

Instantly share code, notes, and snippets.

@adamghill
Last active October 19, 2018 19:23
Show Gist options
  • Save adamghill/7884854 to your computer and use it in GitHub Desktop.
Save adamghill/7884854 to your computer and use it in GitHub Desktop.
Shell script to start up a Django project using pipenv
#!/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