Skip to content Skip to sidebar Skip to footer

Migrations Are Not Taking Place After Pushing My Code On Heroku...?

Well its been 12 hours and i'm still unable to deploy my project properly. I just dont know what is wrong happening. You guys can see throughing error that such models not exist .

Solution 1:

You should not run makemigrations on heroku. Migrations is something that should be added to your repo and then your deployment plan uses those migration files to execute migrations on the DB.

Heroku has a release phase when python manage.py migrate should be executed. If migrations fail, new code that uses them won't be deployed.

If you don't want to add this phase because you don't feel like it - no problem. Just don't run makemigrations.

If, for some reason, you won't be able to create migrations locally, comment out this form, run makemigrations, run migrate and uncomment this code.

If heroku still complains, repeat these steps ^ on heroku as well.

But the idea is that on heroku you run only

  • python manage.py migrate (release phase if possible)
  • gunicorn something something (web dyno)

Post a Comment for "Migrations Are Not Taking Place After Pushing My Code On Heroku...?"