DEV Community

Discussion on: Django, Docker, and PostgreSQL Tutorial

Collapse
 
rogerfc profile image
roger

Thanks for the tutorial, that's just what I needed atm.

I stepped into some problems, though. After switching to postgres you install psycopg2-binary locally but not in the container, right? but it's needed there to run, so I had to do it manually with docker-compose exec web pipenv install psycopg2-binary. Is this the right way?

In any case, when trying to run the migration I get this other error: django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known.

How can I fix this?