For me the problem was that I was running makemigrations && migrate on build Dockerfile, so database wasn't running at that stage. I had to run migrations on CMD instead.