Coder Social home page Coder Social logo

Comments (3)

wsvincent avatar wsvincent commented on July 18, 2024 1

Hi @YashMarmat , Thank you for posting your solution here. I updated that very recently in the book and you can see it in the code base but hadn't been able to respond to your PR. Docker made this breaking change very recently, a frustrating thing. Glad you sorted it out! -Will

from djangoforprofessionals.

samsime avatar samsime commented on July 18, 2024 1

finally !!!! it worked
after spending two days with this issue (frustating hours of my life) i finally resolved this issue,
if you are facing it too then put the following code in your docker-compose.yml file (just below image:postgres11).

environment:

  • "POSTGRES_HOST_AUTH_METHOD=trust"

Note: after applying the above code the local host server can still show the same error but just run that migration command (as in my case i got this error when i tried to run migrations, before that New Database topic of chapter2) mentioned in the book which are:

after changes run below command in terminal (according to book)
docker-compose exec web python manage.py migrate
then
docker-compose exec web python manage.py createsuperuser

for my case, in addition to what you said, I also add
expose:
- "5432"
I add it just before environment in the db service. And it works perfectly.

according to the page
https://stackoverflow.com/questions/51750715/could-not-translate-host-name-db-to-address-using-postgres-docker-compose-and

from djangoforprofessionals.

YashMarmat avatar YashMarmat commented on July 18, 2024

finally !!!! it worked
after spending two days with this issue (frustating hours of my life) i finally resolved this issue,
if you are facing it too then put the following code in your docker-compose.yml file (just below image:postgres11).

environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"

Note: after applying the above code the local host server can still show the same error but just run that migration command (as in my case i got this error when i tried to run migrations, before that New Database topic of chapter2) mentioned in the book which are:

after changes run below command in terminal (according to book)
docker-compose exec web python manage.py migrate
then
docker-compose exec web python manage.py createsuperuser

from djangoforprofessionals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.