Running ./manage.py migrate during Heroku deployment

后端 未结 4 982
遥遥无期
遥遥无期 2020-12-23 13:47

I am working on a Django app, and I would like my Database migrations to be run when deploying on Heroku.

So far we have simply put the following command in the Proc

4条回答
  •  佛祖请我去吃肉
    2020-12-23 14:16

    You can create a file bin/post_compile which will run bash commands after the build.
    Note that it is still considered experimental.
    Read here for more buildpack info.
    See here for an example

    Alternatively, Heroku is working on a new Releases feature, which aims to simplify and solve this process. (Currently in Beta).

    Good luck!

提交回复
热议问题