Skip to content

Instantly share code, notes, and snippets.

@evzpav
Last active March 31, 2019 19:46
Show Gist options
  • Save evzpav/100a15b796108b840407c0f6fe1a07b2 to your computer and use it in GitHub Desktop.
Save evzpav/100a15b796108b840407c0f6fe1a07b2 to your computer and use it in GitHub Desktop.
Create dokku config enough for dokku deployment. Create requirements.txt, Procfile,
#!/bin/bash
PROJECT_NAME=dokku-django
VIRTUAL_ENV_PATH=venv
#install dependencies and add to requirements.txt
source $VIRTUAL_ENV_PATH/bin/activate
pip install gunicorn
pip install django-heroku
pip freeze > requirements.txt
#add Procfile
echo "web: gunicorn $PROJECT_NAME.wsgi" > Procfile
#add django heroku function to setting.py inside app directory
cd $PROJECT_NAME
echo "
import django_heroku
django_heroku.settings(locals())
" >> settings.py
cd ..
# create deploy script
echo "
#!/bin/bash
git add .
git commit -m \"up to dokku\"
git push dokku master " > up_dokku.sh
chmod 700 up_dokku.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment