Last active
October 23, 2020 08:42
-
-
Save kylefox/7044491259b6b2586ca1 to your computer and use it in GitHub Desktop.
Run Django database migrations after deploy to Heroku. This file must live at `bin/post_compile` within your root project directory.
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
# !/usr/bin/env bash | |
# File path should be ./bin/post_compile | |
# (.sh extension added in Gist just to enable shell syntax highlighting. | |
# https://discussion.heroku.com/t/django-automaticlly-run-syncdb-and-migrations-after-heroku-deploy-with-a-buildpack-or-otherwise/466/7 | |
echo "=> Performing database migrations..." | |
python manage.py migrate |
Just do:
release: python manage.py migrate --no-input
web: gunicorn project_name.wsgi
and you will be fine.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i think you can just use the
release
command in your Procfilefor exemple to migrate :
or runs a script :
the command
release
runs after :