Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django on Heroku - ProgrammingError at / relation "..." does not exist

Tags:

django

heroku

I'm getting this error. I know you usually get this error because the databases wasn't properly migrated.

When I run heroku local web, the website works fine when I go to localhost:5000.

However after I deploy the app to heroku with git push heroku master, the error comes up.

In other words, it works in my local environment. But it does not work after deploying to heroku.

I have Heroku-Postgres installed as an add-on in heroku.

What could be causing this?

like image 624
Valachio Avatar asked Oct 25 '25 20:10

Valachio


1 Answers

excute migrations and makemigrations in bash heroku. open the terminal in the local project folder and give the following commands:

heroku run bash
~$  ./manage.py makemigrations
~$  ./manage.py migrate
~$  exit
like image 81
LSM Avatar answered Oct 29 '25 20:10

LSM